diff --git a/ipv6/icmp_test.go b/ipv6/icmp_test.go index bdde2fdb..940a7aa8 100644 --- a/ipv6/icmp_test.go +++ b/ipv6/icmp_test.go @@ -34,7 +34,7 @@ func TestICMPString(t *testing.T) { func TestICMPFilter(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } @@ -61,7 +61,7 @@ func TestICMPFilter(t *testing.T) { func TestSetICMPFilter(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { diff --git a/ipv6/mocktransponder_test.go b/ipv6/mocktransponder_test.go index 6efe56c6..1837c746 100644 --- a/ipv6/mocktransponder_test.go +++ b/ipv6/mocktransponder_test.go @@ -10,6 +10,7 @@ import ( ) func connector(t *testing.T, network, addr string, done chan<- bool) { + t.Helper() defer func() { done <- true }() c, err := net.Dial(network, addr) @@ -21,6 +22,7 @@ func connector(t *testing.T, network, addr string, done chan<- bool) { } func acceptor(t *testing.T, ln net.Listener, done chan<- bool) { + t.Helper() defer func() { done <- true }() c, err := ln.Accept() diff --git a/ipv6/multicast_test.go b/ipv6/multicast_test.go index 50442c36..6ca6fd1c 100644 --- a/ipv6/multicast_test.go +++ b/ipv6/multicast_test.go @@ -29,7 +29,7 @@ var packetConnReadWriteMulticastUDPTests = []struct { func TestPacketConnReadWriteMulticastUDP(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { @@ -129,7 +129,7 @@ var packetConnReadWriteMulticastICMPTests = []struct { func TestPacketConnReadWriteMulticastICMP(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { diff --git a/ipv6/multicastlistener_test.go b/ipv6/multicastlistener_test.go index 1ee0549d..91d2b1df 100644 --- a/ipv6/multicastlistener_test.go +++ b/ipv6/multicastlistener_test.go @@ -21,7 +21,7 @@ var udpMultipleGroupListenerTests = []net.Addr{ func TestUDPSinglePacketConnWithMultipleGroupListeners(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { @@ -61,7 +61,7 @@ func TestUDPSinglePacketConnWithMultipleGroupListeners(t *testing.T) { func TestUDPMultiplePacketConnWithMultipleGroupListeners(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { @@ -116,7 +116,7 @@ func TestUDPMultiplePacketConnWithMultipleGroupListeners(t *testing.T) { func TestUDPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { @@ -172,7 +172,7 @@ func TestUDPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) { func TestIPSinglePacketConnWithSingleGroupListener(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { @@ -216,7 +216,7 @@ func TestIPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) { switch runtime.GOOS { case "darwin", "dragonfly", "openbsd": // platforms that return fe80::1%lo0: bind: can't assign requested address t.Skipf("not supported on %s", runtime.GOOS) - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { diff --git a/ipv6/multicastsockopt_test.go b/ipv6/multicastsockopt_test.go index 9906e876..2cb2da2d 100644 --- a/ipv6/multicastsockopt_test.go +++ b/ipv6/multicastsockopt_test.go @@ -26,7 +26,7 @@ var packetConnMulticastSocketOptionTests = []struct { func TestPacketConnMulticastSocketOptions(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { @@ -73,6 +73,8 @@ type testIPv6MulticastConn interface { } func testMulticastSocketOptions(t *testing.T, c testIPv6MulticastConn, ifi *net.Interface, grp net.Addr) { + t.Helper() + const hoplim = 255 if err := c.SetMulticastHopLimit(hoplim); err != nil { t.Error(err) @@ -111,6 +113,8 @@ func testMulticastSocketOptions(t *testing.T, c testIPv6MulticastConn, ifi *net. } func testSourceSpecificMulticastSocketOptions(t *testing.T, c testIPv6MulticastConn, ifi *net.Interface, grp, src net.Addr) { + t.Helper() + // MCAST_JOIN_GROUP -> MCAST_BLOCK_SOURCE -> MCAST_UNBLOCK_SOURCE -> MCAST_LEAVE_GROUP if err := c.JoinGroup(ifi, grp); err != nil { t.Error(err) diff --git a/ipv6/readwrite_test.go b/ipv6/readwrite_test.go index e069cf80..18d5f9d6 100644 --- a/ipv6/readwrite_test.go +++ b/ipv6/readwrite_test.go @@ -19,6 +19,11 @@ import ( ) func BenchmarkReadWriteUnicast(b *testing.B) { + switch runtime.GOOS { + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": + b.Skipf("not supported on %s", runtime.GOOS) + } + c, err := nettest.NewLocalPacketListener("udp6") if err != nil { b.Skipf("not supported on %s/%s: %v", runtime.GOOS, runtime.GOARCH, err) @@ -66,7 +71,7 @@ func BenchmarkReadWriteUnicast(b *testing.B) { func BenchmarkPacketConnReadWriteUnicast(b *testing.B) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": b.Skipf("not supported on %s", runtime.GOOS) } @@ -213,7 +218,7 @@ func BenchmarkPacketConnReadWriteUnicast(b *testing.B) { func TestPacketConnConcurrentReadWriteUnicastUDP(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { @@ -297,7 +302,7 @@ func TestPacketConnConcurrentReadWriteUnicastUDP(t *testing.T) { func TestPacketConnConcurrentReadWriteUnicast(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } @@ -350,6 +355,8 @@ func TestPacketConnConcurrentReadWriteUnicast(t *testing.T) { } func testPacketConnConcurrentReadWriteUnicast(t *testing.T, p *ipv6.PacketConn, data []byte, dst net.Addr, batch bool) { + t.Helper() + ifi := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagLoopback) cf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU diff --git a/ipv6/sockopt_test.go b/ipv6/sockopt_test.go index add045e3..0ff911d4 100644 --- a/ipv6/sockopt_test.go +++ b/ipv6/sockopt_test.go @@ -19,7 +19,7 @@ var supportsIPv6 bool = nettest.SupportsIPv6() func TestConnInitiatorPathMTU(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { @@ -57,7 +57,7 @@ func TestConnInitiatorPathMTU(t *testing.T) { func TestConnResponderPathMTU(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { @@ -95,7 +95,7 @@ func TestConnResponderPathMTU(t *testing.T) { func TestPacketConnChecksum(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { diff --git a/ipv6/unicast_test.go b/ipv6/unicast_test.go index 159bb39b..25fb4eb2 100644 --- a/ipv6/unicast_test.go +++ b/ipv6/unicast_test.go @@ -20,7 +20,7 @@ import ( func TestPacketConnReadWriteUnicastUDP(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { @@ -78,7 +78,7 @@ func TestPacketConnReadWriteUnicastUDP(t *testing.T) { func TestPacketConnReadWriteUnicastICMP(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { diff --git a/ipv6/unicastsockopt_test.go b/ipv6/unicastsockopt_test.go index 69adefe8..2f833736 100644 --- a/ipv6/unicastsockopt_test.go +++ b/ipv6/unicastsockopt_test.go @@ -16,7 +16,7 @@ import ( func TestConnUnicastSocketOptions(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { @@ -61,7 +61,7 @@ var packetConnUnicastSocketOptionTests = []struct { func TestPacketConnUnicastSocketOptions(t *testing.T) { switch runtime.GOOS { - case "js", "nacl", "plan9", "windows": + case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": t.Skipf("not supported on %s", runtime.GOOS) } if !supportsIPv6 { @@ -92,6 +92,8 @@ type testIPv6UnicastConn interface { } func testUnicastSocketOptions(t *testing.T, c testIPv6UnicastConn) { + t.Helper() + tclass := iana.DiffServCS0 | iana.NotECNTransport if err := c.SetTrafficClass(tclass); err != nil { switch runtime.GOOS {