import (
"fmt"
+ "internal/testenv"
"reflect"
"runtime"
"testing"
return ""
}
-func TestInterfaces(t *testing.T) {
- if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
- t.Skipf("sysctl is not supported on iOS")
+func condSkipInterfaceTest(t *testing.T) {
+ t.Helper()
+ switch runtime.GOOS {
+ case "darwin":
+ if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
+ t.Skipf("sysctl is not supported on iOS")
+ }
+ case "dragonfly":
+ testenv.SkipFlaky(t, 34368)
}
+}
+
+func TestInterfaces(t *testing.T) {
+ condSkipInterfaceTest(t)
ift, err := Interfaces()
if err != nil {
t.Fatal(err)
}
func TestInterfaceAddrs(t *testing.T) {
- if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
- t.Skipf("sysctl is not supported on iOS")
- }
+ condSkipInterfaceTest(t)
ift, err := Interfaces()
if err != nil {
t.Fatal(err)
}
func TestInterfaceUnicastAddrs(t *testing.T) {
- if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
- t.Skipf("sysctl is not supported on iOS")
- }
+ condSkipInterfaceTest(t)
ift, err := Interfaces()
if err != nil {
t.Fatal(err)
}
func TestInterfaceMulticastAddrs(t *testing.T) {
- if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
- t.Skipf("sysctl is not supported on iOS")
- }
+ condSkipInterfaceTest(t)
ift, err := Interfaces()
if err != nil {
t.Fatal(err)