Installing packages and starting/enabling services is not yet supported.
There are minor limitations when handling symlinks (see README.adoc).
/var/tmp is a symlink on OpenBSD so just remove this test.
--- /dev/null
+image: openbsd/latest
+packages:
+ - go
+ - gmake
+ - xz
+tasks:
+ - all: |
+ # OpenBSD 6.8 only ships with Go 1.15
+ curl -O https://ruderich.eu/go-1.16.3-openbsd-amd64.tar.xz
+ xz -d go-1.16.3-openbsd-amd64.tar.xz
+ tar xf go-1.16.3-openbsd-amd64.tar
+ mv go-1.16.3 go
+ #
+ doas ln -sf /usr/local/bin/gmake /usr/bin/make
+ cd safcm
+ # Go does not yet support -race on OpenBSD
+ ./ci/run GOFLAGS=
** GNU/Linux with common commands (`uname`, `id`, `stat`, `sha512sum`,
`cat`, `mktemp`, `rm`, `ln`, `chmod`)
** FreeBSD (same commands, but uses `sha512`)
+ ** OpenBSD (same commands, but uses `sha512`)
* SSH server
* to install packages:
** `apt-get` (Debian or derivative)
PATH=$HOME/go/bin:$PATH
export PATH
-make
-make test
+flags=
+if test $# -ne 0; then
+ flags="$*"
+fi
+
+make $flags
+make test $flags
# Strict umask
umask 077
rm -rf *
git checkout .
-make
-make test
+make $flags
+make test $flags
# Additional static checks only run in CI
go get honnef.co/go/tools/cmd/staticcheck
build freebsd amd64
build linux amd64
+build openbsd amd64
build_arm linux arm 7
# TODO: support more operating systems and architectures
Gid: 0,
OrigGroup: "group",
},
- "/var/tmp": {
- Path: "/var/tmp",
- Mode: fs.ModeDir | 0777 | fs.ModeSticky,
- Uid: 0,
- Gid: 0,
- OrigGroup: "group",
- },
},
},
nil,
`4: sync remote: files: "/" (group): unchanged`,
`4: sync remote: files: "/etc" (group): unchanged`,
`4: sync remote: files: "/tmp" (group): unchanged`,
- `4: sync remote: files: "/var/tmp" (group): unchanged`,
},
nil,
},
}
// Regular users cannot create sticky files
- skipInvalidSticky := runtime.GOOS == "freebsd"
+ skipInvalidSticky := runtime.GOOS == "freebsd" ||
+ runtime.GOOS == "openbsd"
chmod("files-invalid-perm-dir/files", 0500)
defer chmod("files-invalid-perm-dir/files", 0700)
sha512sum "$1"
}
`
- case "freebsd":
+ case "freebsd", "openbsd":
compat = `
dir_stat='41777 0 0'
file_stat="100700 $(id -u) $(id -g)"
}
func connGetGoos(stdin io.Writer, stdout *bufio.Reader) (string, error) {
- _, err := fmt.Fprintln(stdin, "uname -o")
+ _, err := fmt.Fprintln(stdin, "uname")
if err != nil {
return "", err
}
// NOTE: Adapt helper uploading in dialSSH() when adding new systems
var goos string
switch x {
- case "GNU/Linux":
+ case "Linux":
goos = "linux"
case "FreeBSD":
goos = "freebsd"
+ case "OpenBSD":
+ goos = "openbsd"
default:
- return "", fmt.Errorf("unsupported OS %q (`uname -o`)", x)
+ return "", fmt.Errorf("unsupported OS %q (`uname`)", x)
}
return goos, nil
}