]> Cypherpunks repositories - gostls13.git/commitdiff
net: make all.bat run for ordinary Windows users
authorRuss Cox <rsc@golang.org>
Mon, 16 Sep 2013 18:05:06 +0000 (14:05 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 16 Sep 2013 18:05:06 +0000 (14:05 -0400)
This CL is required for all.bat to work out of the box on
my Windows 8 laptop.

These tests either require the firewall to be turned off
or require the user to be in the Administrators group.
I don't know which.

Alex may follow up with a refinement of the test to
allow them to run if the user is in the Administrators
group.

Fixes #6392.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13421049

src/pkg/net/ipraw_test.go
src/pkg/net/multicast_test.go
src/pkg/net/packetconn_test.go
src/pkg/net/protoconn_test.go

index 7f83891cc709db624c5c4cb05860ae37b4e34729..c8e3c846f4f4a5a89a72d68adaceff144930cc53 100644 (file)
@@ -84,6 +84,9 @@ func TestConnICMPEcho(t *testing.T) {
        case "plan9":
                t.Skipf("skipping test on %q", runtime.GOOS)
        case "windows":
+               if testing.Short() || !*testExternal {
+                       t.Skipf("skipping test on %q to avoid network firewall", runtime.GOOS)
+               }
        default:
                if os.Getuid() != 0 {
                        t.Skip("skipping test; must be root")
@@ -158,6 +161,9 @@ func TestPacketConnICMPEcho(t *testing.T) {
        case "plan9":
                t.Skipf("skipping test on %q", runtime.GOOS)
        case "windows":
+               if testing.Short() || !*testExternal {
+                       t.Skipf("skipping test on %q to avoid network firewall", runtime.GOOS)
+               }
        default:
                if os.Getuid() != 0 {
                        t.Skip("skipping test; must be root")
index 5660fd42f8c712feea6a4c8050444b094bc2349e..31a650aa28003c4c005370f87ec4f55ab26dd898 100644 (file)
@@ -25,6 +25,10 @@ var ipv4MulticastListenerTests = []struct {
 // port.
 func TestIPv4MulticastListener(t *testing.T) {
        switch runtime.GOOS {
+       case "windows":
+               if testing.Short() || !*testExternal {
+                       t.Skipf("skipping test on %q to avoid network firewall", runtime.GOOS)
+               }
        case "plan9":
                t.Skipf("skipping test on %q", runtime.GOOS)
        }
index f779b4ad4745116e96c8c1e84886b441d3cdefe2..e64457bd37874155f8227d0d3a617aca95cc6220 100644 (file)
@@ -32,6 +32,9 @@ func packetConnTestData(t *testing.T, net string, i int) ([]byte, func()) {
                                t.Logf("skipping %q test on %q", net, runtime.GOOS)
                        }
                case "windows":
+                       if testing.Short() || !*testExternal {
+                               t.Skipf("skipping test on %q to avoid network firewall", runtime.GOOS)
+                       }
                default:
                        if os.Getuid() != 0 {
                                return nil, func() {
index 3afa41b41137de0ca5531162febceea5cb191e85..2c268a91d210b68367cd6939d8c19abde5f66a8b 100644 (file)
@@ -177,6 +177,9 @@ func TestIPConnSpecificMethods(t *testing.T) {
        case "plan9":
                t.Skipf("skipping test on %q", runtime.GOOS)
        case "windows":
+               if testing.Short() || !*testExternal {
+                       t.Skipf("skipping test on %q to avoid network firewall", runtime.GOOS)
+               }
        default:
                if os.Getuid() != 0 {
                        t.Skipf("skipping test; must be root")