all: use of nettest, remove internal/nettest
This change uses the nettest package where possible and removes the
internal/nettest package.
Change-Id: I5615a3ab7957183fecea6b5646df99dbb7c186e2
Reviewed-on: https://go-review.googlesource.com/c/net/+/123057
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
diff --git a/ipv6/multicastsockopt_test.go b/ipv6/multicastsockopt_test.go
index 2cb2da2..a399945 100644
--- a/ipv6/multicastsockopt_test.go
+++ b/ipv6/multicastsockopt_test.go
@@ -9,8 +9,8 @@
"runtime"
"testing"
- "golang.org/x/net/internal/nettest"
"golang.org/x/net/ipv6"
+ "golang.org/x/net/nettest"
)
var packetConnMulticastSocketOptionTests = []struct {
@@ -29,18 +29,18 @@
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
- if !supportsIPv6 {
+ if !nettest.SupportsIPv6() {
t.Skip("ipv6 is not supported")
}
- ifi := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagMulticast|net.FlagLoopback)
- if ifi == nil {
+ ifi, err := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagMulticast|net.FlagLoopback)
+ if err != nil {
t.Skipf("not available on %s", runtime.GOOS)
}
- m, ok := nettest.SupportsRawIPSocket()
+ ok := nettest.SupportsRawSocket()
for _, tt := range packetConnMulticastSocketOptionTests {
if tt.net == "ip6" && !ok {
- t.Log(m)
+ t.Logf("not supported on %s/%s", runtime.GOOS, runtime.GOARCH)
continue
}
c, err := net.ListenPacket(tt.net+tt.proto, tt.addr)