t.Skipf("not implemented a way to cancel dial racers in TCP SYN-SENT state on %s", runtime.GOOS)
}
if !supportsIPv4 || !supportsIPv6 {
- t.Skip("ipv4 or ipv6 is not supported")
+ t.Skip("both IPv4 and IPv6 are required")
}
origTestHookLookupIP := testHookLookupIP
func TestDialerDualStack(t *testing.T) {
if !supportsIPv4 || !supportsIPv6 {
- t.Skip("ipv4 or ipv6 is not supported")
+ t.Skip("both IPv4 and IPv6 are required")
}
origTestHookLookupIP := testHookLookupIP
func TestAddrList(t *testing.T) {
if !supportsIPv4 || !supportsIPv6 {
- t.Skip("ipv4 or ipv6 is not supported")
+ t.Skip("both IPv4 and IPv6 are required")
}
for i, tt := range addrListTests {
// listening address and same port.
func TestDualStackTCPListener(t *testing.T) {
switch runtime.GOOS {
+ case "dragonfly":
+ t.Skip("not supported on DragonFly, see golang.org/issue/10729")
case "nacl", "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
+ if !supportsIPv4 || !supportsIPv6 {
+ t.Skip("both IPv4 and IPv6 are required")
+ }
for _, tt := range dualStackTCPListenerTests {
if !testableListenArgs(tt.network1, JoinHostPort(tt.address1, "0"), "") {
case "nacl", "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
+ if !supportsIPv4 || !supportsIPv6 {
+ t.Skip("both IPv4 and IPv6 are required")
+ }
for _, tt := range dualStackUDPListenerTests {
if !testableListenArgs(tt.network1, JoinHostPort(tt.address1, "0"), "") {
return false
}
- // Test functionality of IPv6 communication using AF_INET6
- // sockets.
+ // Test functionality of IPv4 communication using AF_INET and
+ // IPv6 communication using AF_INET6 sockets.
+ if !supportsIPv4 && ip.To4() != nil {
+ return false
+ }
if !supportsIPv6 && ip.To16() != nil && ip.To4() == nil {
return false
}
+ cip := ParseIP(client)
+ if cip != nil {
+ if !supportsIPv4 && cip.To4() != nil {
+ return false
+ }
+ if !supportsIPv6 && cip.To16() != nil && cip.To4() == nil {
+ return false
+ }
+ }
// Test functionality of IPv4 communication using AF_INET6
// sockets.
- cip := ParseIP(client)
if !supportsIPv4map && (network == "tcp" || network == "udp" || network == "ip") && wildcard {
// At this point, we prefer IPv4 when ip is nil.
// See favoriteAddrFamily for further information.