feat: add support for OpenBSD (#703)
Closes https://github.com/ooni/probe/issues/2052
This commit is contained in:
committed by
GitHub
parent
74e31d5cc1
commit
07f8db9dc2
@@ -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"
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user