Skip to content

Commit

Permalink
net: skip some interface tests on Dragonfly for now
Browse files Browse the repository at this point in the history
Skipping tests isn't great, but neither is a wall of red masking other
potential regressions.

Updates golang#34368

Change-Id: I5fdfa54846dd8d648001594c74f059af8af52247
Reviewed-on: https://go-review.googlesource.com/c/go/+/201482
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
  • Loading branch information
bradfitz committed Oct 17, 2019
1 parent 2449444 commit 728a876
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions src/net/interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package net

import (
"fmt"
"internal/testenv"
"reflect"
"runtime"
"testing"
Expand Down Expand Up @@ -50,10 +51,20 @@ func ipv6LinkLocalUnicastAddr(ifi *Interface) string {
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)
Expand Down Expand Up @@ -85,9 +96,7 @@ func TestInterfaces(t *testing.T) {
}

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)
Expand All @@ -107,9 +116,7 @@ func TestInterfaceAddrs(t *testing.T) {
}

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)
Expand Down Expand Up @@ -137,9 +144,7 @@ func TestInterfaceUnicastAddrs(t *testing.T) {
}

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)
Expand Down

0 comments on commit 728a876

Please sign in to comment.