Skip to content

Commit 9f648a6

Browse files
committed
ipv6: skip tests on aix, fuchsia and hurd
Also marks test helper functions. Change-Id: I1baf791b6d4199699db20834fa6e1a3bd0733cf0 Reviewed-on: https://go-review.googlesource.com/c/net/+/167340 Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matt Layher <mdlayher@gmail.com>
1 parent 7949ac6 commit 9f648a6

9 files changed

+35
-20
lines changed

ipv6/icmp_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestICMPString(t *testing.T) {
3434

3535
func TestICMPFilter(t *testing.T) {
3636
switch runtime.GOOS {
37-
case "js", "nacl", "plan9", "windows":
37+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
3838
t.Skipf("not supported on %s", runtime.GOOS)
3939
}
4040

@@ -61,7 +61,7 @@ func TestICMPFilter(t *testing.T) {
6161

6262
func TestSetICMPFilter(t *testing.T) {
6363
switch runtime.GOOS {
64-
case "js", "nacl", "plan9", "windows":
64+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
6565
t.Skipf("not supported on %s", runtime.GOOS)
6666
}
6767
if !supportsIPv6 {

ipv6/mocktransponder_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
)
1111

1212
func connector(t *testing.T, network, addr string, done chan<- bool) {
13+
t.Helper()
1314
defer func() { done <- true }()
1415

1516
c, err := net.Dial(network, addr)
@@ -21,6 +22,7 @@ func connector(t *testing.T, network, addr string, done chan<- bool) {
2122
}
2223

2324
func acceptor(t *testing.T, ln net.Listener, done chan<- bool) {
25+
t.Helper()
2426
defer func() { done <- true }()
2527

2628
c, err := ln.Accept()

ipv6/multicast_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var packetConnReadWriteMulticastUDPTests = []struct {
2929

3030
func TestPacketConnReadWriteMulticastUDP(t *testing.T) {
3131
switch runtime.GOOS {
32-
case "js", "nacl", "plan9", "windows":
32+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
3333
t.Skipf("not supported on %s", runtime.GOOS)
3434
}
3535
if !supportsIPv6 {
@@ -129,7 +129,7 @@ var packetConnReadWriteMulticastICMPTests = []struct {
129129

130130
func TestPacketConnReadWriteMulticastICMP(t *testing.T) {
131131
switch runtime.GOOS {
132-
case "js", "nacl", "plan9", "windows":
132+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
133133
t.Skipf("not supported on %s", runtime.GOOS)
134134
}
135135
if !supportsIPv6 {

ipv6/multicastlistener_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var udpMultipleGroupListenerTests = []net.Addr{
2121

2222
func TestUDPSinglePacketConnWithMultipleGroupListeners(t *testing.T) {
2323
switch runtime.GOOS {
24-
case "js", "nacl", "plan9", "windows":
24+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
2525
t.Skipf("not supported on %s", runtime.GOOS)
2626
}
2727
if !supportsIPv6 {
@@ -61,7 +61,7 @@ func TestUDPSinglePacketConnWithMultipleGroupListeners(t *testing.T) {
6161

6262
func TestUDPMultiplePacketConnWithMultipleGroupListeners(t *testing.T) {
6363
switch runtime.GOOS {
64-
case "js", "nacl", "plan9", "windows":
64+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
6565
t.Skipf("not supported on %s", runtime.GOOS)
6666
}
6767
if !supportsIPv6 {
@@ -116,7 +116,7 @@ func TestUDPMultiplePacketConnWithMultipleGroupListeners(t *testing.T) {
116116

117117
func TestUDPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) {
118118
switch runtime.GOOS {
119-
case "js", "nacl", "plan9", "windows":
119+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
120120
t.Skipf("not supported on %s", runtime.GOOS)
121121
}
122122
if !supportsIPv6 {
@@ -172,7 +172,7 @@ func TestUDPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) {
172172

173173
func TestIPSinglePacketConnWithSingleGroupListener(t *testing.T) {
174174
switch runtime.GOOS {
175-
case "js", "nacl", "plan9", "windows":
175+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
176176
t.Skipf("not supported on %s", runtime.GOOS)
177177
}
178178
if !supportsIPv6 {
@@ -216,7 +216,7 @@ func TestIPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) {
216216
switch runtime.GOOS {
217217
case "darwin", "dragonfly", "openbsd": // platforms that return fe80::1%lo0: bind: can't assign requested address
218218
t.Skipf("not supported on %s", runtime.GOOS)
219-
case "js", "nacl", "plan9", "windows":
219+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
220220
t.Skipf("not supported on %s", runtime.GOOS)
221221
}
222222
if !supportsIPv6 {

ipv6/multicastsockopt_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var packetConnMulticastSocketOptionTests = []struct {
2626

2727
func TestPacketConnMulticastSocketOptions(t *testing.T) {
2828
switch runtime.GOOS {
29-
case "js", "nacl", "plan9", "windows":
29+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
3030
t.Skipf("not supported on %s", runtime.GOOS)
3131
}
3232
if !supportsIPv6 {
@@ -73,6 +73,8 @@ type testIPv6MulticastConn interface {
7373
}
7474

7575
func testMulticastSocketOptions(t *testing.T, c testIPv6MulticastConn, ifi *net.Interface, grp net.Addr) {
76+
t.Helper()
77+
7678
const hoplim = 255
7779
if err := c.SetMulticastHopLimit(hoplim); err != nil {
7880
t.Error(err)
@@ -111,6 +113,8 @@ func testMulticastSocketOptions(t *testing.T, c testIPv6MulticastConn, ifi *net.
111113
}
112114

113115
func testSourceSpecificMulticastSocketOptions(t *testing.T, c testIPv6MulticastConn, ifi *net.Interface, grp, src net.Addr) {
116+
t.Helper()
117+
114118
// MCAST_JOIN_GROUP -> MCAST_BLOCK_SOURCE -> MCAST_UNBLOCK_SOURCE -> MCAST_LEAVE_GROUP
115119
if err := c.JoinGroup(ifi, grp); err != nil {
116120
t.Error(err)

ipv6/readwrite_test.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ import (
1919
)
2020

2121
func BenchmarkReadWriteUnicast(b *testing.B) {
22+
switch runtime.GOOS {
23+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
24+
b.Skipf("not supported on %s", runtime.GOOS)
25+
}
26+
2227
c, err := nettest.NewLocalPacketListener("udp6")
2328
if err != nil {
2429
b.Skipf("not supported on %s/%s: %v", runtime.GOOS, runtime.GOARCH, err)
@@ -66,7 +71,7 @@ func BenchmarkReadWriteUnicast(b *testing.B) {
6671

6772
func BenchmarkPacketConnReadWriteUnicast(b *testing.B) {
6873
switch runtime.GOOS {
69-
case "js", "nacl", "plan9", "windows":
74+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
7075
b.Skipf("not supported on %s", runtime.GOOS)
7176
}
7277

@@ -213,7 +218,7 @@ func BenchmarkPacketConnReadWriteUnicast(b *testing.B) {
213218

214219
func TestPacketConnConcurrentReadWriteUnicastUDP(t *testing.T) {
215220
switch runtime.GOOS {
216-
case "js", "nacl", "plan9", "windows":
221+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
217222
t.Skipf("not supported on %s", runtime.GOOS)
218223
}
219224
if !supportsIPv6 {
@@ -297,7 +302,7 @@ func TestPacketConnConcurrentReadWriteUnicastUDP(t *testing.T) {
297302

298303
func TestPacketConnConcurrentReadWriteUnicast(t *testing.T) {
299304
switch runtime.GOOS {
300-
case "js", "nacl", "plan9", "windows":
305+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
301306
t.Skipf("not supported on %s", runtime.GOOS)
302307
}
303308

@@ -350,6 +355,8 @@ func TestPacketConnConcurrentReadWriteUnicast(t *testing.T) {
350355
}
351356

352357
func testPacketConnConcurrentReadWriteUnicast(t *testing.T, p *ipv6.PacketConn, data []byte, dst net.Addr, batch bool) {
358+
t.Helper()
359+
353360
ifi := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagLoopback)
354361
cf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU
355362

ipv6/sockopt_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var supportsIPv6 bool = nettest.SupportsIPv6()
1919

2020
func TestConnInitiatorPathMTU(t *testing.T) {
2121
switch runtime.GOOS {
22-
case "js", "nacl", "plan9", "windows":
22+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
2323
t.Skipf("not supported on %s", runtime.GOOS)
2424
}
2525
if !supportsIPv6 {
@@ -57,7 +57,7 @@ func TestConnInitiatorPathMTU(t *testing.T) {
5757

5858
func TestConnResponderPathMTU(t *testing.T) {
5959
switch runtime.GOOS {
60-
case "js", "nacl", "plan9", "windows":
60+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
6161
t.Skipf("not supported on %s", runtime.GOOS)
6262
}
6363
if !supportsIPv6 {
@@ -95,7 +95,7 @@ func TestConnResponderPathMTU(t *testing.T) {
9595

9696
func TestPacketConnChecksum(t *testing.T) {
9797
switch runtime.GOOS {
98-
case "js", "nacl", "plan9", "windows":
98+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
9999
t.Skipf("not supported on %s", runtime.GOOS)
100100
}
101101
if !supportsIPv6 {

ipv6/unicast_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020

2121
func TestPacketConnReadWriteUnicastUDP(t *testing.T) {
2222
switch runtime.GOOS {
23-
case "js", "nacl", "plan9", "windows":
23+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
2424
t.Skipf("not supported on %s", runtime.GOOS)
2525
}
2626
if !supportsIPv6 {
@@ -78,7 +78,7 @@ func TestPacketConnReadWriteUnicastUDP(t *testing.T) {
7878

7979
func TestPacketConnReadWriteUnicastICMP(t *testing.T) {
8080
switch runtime.GOOS {
81-
case "js", "nacl", "plan9", "windows":
81+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
8282
t.Skipf("not supported on %s", runtime.GOOS)
8383
}
8484
if !supportsIPv6 {

ipv6/unicastsockopt_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616

1717
func TestConnUnicastSocketOptions(t *testing.T) {
1818
switch runtime.GOOS {
19-
case "js", "nacl", "plan9", "windows":
19+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
2020
t.Skipf("not supported on %s", runtime.GOOS)
2121
}
2222
if !supportsIPv6 {
@@ -61,7 +61,7 @@ var packetConnUnicastSocketOptionTests = []struct {
6161

6262
func TestPacketConnUnicastSocketOptions(t *testing.T) {
6363
switch runtime.GOOS {
64-
case "js", "nacl", "plan9", "windows":
64+
case "aix", "fuchsia", "hurd", "js", "nacl", "plan9", "windows":
6565
t.Skipf("not supported on %s", runtime.GOOS)
6666
}
6767
if !supportsIPv6 {
@@ -92,6 +92,8 @@ type testIPv6UnicastConn interface {
9292
}
9393

9494
func testUnicastSocketOptions(t *testing.T, c testIPv6UnicastConn) {
95+
t.Helper()
96+
9597
tclass := iana.DiffServCS0 | iana.NotECNTransport
9698
if err := c.SetTrafficClass(tclass); err != nil {
9799
switch runtime.GOOS {

0 commit comments

Comments
 (0)