]> Cypherpunks repositories - gostls13.git/commitdiff
net: don't run IP stack required tests on IP stack unimplemented kernels
authorMikio Hara <mikioh.mikioh@gmail.com>
Tue, 12 May 2015 14:11:28 +0000 (23:11 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Wed, 13 May 2015 05:16:19 +0000 (05:16 +0000)
Fixes #10787.

Change-Id: I35c96808a713dafb1f0fea301fa3f3528fe6a5bf
Reviewed-on: https://go-review.googlesource.com/9948
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
src/net/main_test.go
src/net/platform_test.go

index a56b9cd5f9584d6bff268ecbab6db33fc8c57e2a..4288e2add25133513672d292d8e164e202ef7911 100644 (file)
@@ -97,7 +97,7 @@ func printLeakedGoroutines() {
        if len(gss) == 0 {
                return
        }
-       fmt.Fprintf(os.Stderr, "Leaked goroutines:\n")
+       fmt.Fprintf(os.Stderr, "Running goroutines:\n")
        for _, gs := range gss {
                fmt.Fprintf(os.Stderr, "%v\n", gs)
        }
@@ -130,7 +130,7 @@ func printLeakedSockets() {
        if len(sos) == 0 {
                return
        }
-       fmt.Fprintf(os.Stderr, "Leaked sockets:\n")
+       fmt.Fprintf(os.Stderr, "Inflight sockets:\n")
        for s, so := range sos {
                fmt.Fprintf(os.Stderr, "%v: %v\n", s, so)
        }
index b700091dc5de8e6ef17bd6b1646d2ac8f1ba0a3a..d6248520f33b6910e0d11603c9d67e3a2b248b0a 100644 (file)
@@ -14,7 +14,8 @@ import (
 // testableNetwork reports whether network is testable on the current
 // platform configuration.
 func testableNetwork(network string) bool {
-       switch ss := strings.Split(network, ":"); ss[0] {
+       ss := strings.Split(network, ":")
+       switch ss[0] {
        case "ip+nopriv":
                switch runtime.GOOS {
                case "nacl":
@@ -46,6 +47,16 @@ func testableNetwork(network string) bool {
                        return false
                }
        }
+       switch ss[0] {
+       case "tcp4", "udp4", "ip4":
+               if !supportsIPv4 {
+                       return false
+               }
+       case "tcp6", "udp6", "ip6":
+               if !supportsIPv6 {
+                       return false
+               }
+       }
        return true
 }