feat: add support for OpenBSD (#703)

Closes https://github.com/ooni/probe/issues/2052
This commit is contained in:
Dionysis Grigoropoulos 2022-03-08 13:25:33 +02:00 committed by GitHub
commit 07f8db9dc2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 310 additions and 4 deletions

View file

@ -18,7 +18,9 @@ import "runtime"
//
// 5. "freebsd"
//
// 6. "unknown"
// 6. "openbsd"
//
// 7. "unknown"
//
// You should use this name to annotate measurements.
func Name() string {
@ -32,7 +34,7 @@ func name(goos string) string {
//
// See https://golang.org/doc/go1.16#darwin
switch goos {
case "android", "freebsd", "ios", "linux", "windows":
case "android", "freebsd", "openbsd", "ios", "linux", "windows":
return goos
case "darwin":
return "macos"

View file

@ -8,7 +8,7 @@ import (
func TestGood(t *testing.T) {
var expected bool
switch Name() {
case "android", "freebsd", "ios", "linux", "macos", "windows":
case "android", "freebsd", "openbsd", "ios", "linux", "macos", "windows":
expected = true
}
if !expected {
@ -26,6 +26,9 @@ func TestName(t *testing.T) {
}, {
expected: "freebsd",
goos: "freebsd",
}, {
expected: "openbsd",
goos: "openbsd",
}, {
expected: "ios",
goos: "ios",