Commit d9fdf88f authored by Russ Cox's avatar Russ Cox

net: make all.bat run for ordinary Windows users

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
parent 647eaed9
...@@ -84,6 +84,9 @@ func TestConnICMPEcho(t *testing.T) { ...@@ -84,6 +84,9 @@ func TestConnICMPEcho(t *testing.T) {
case "plan9": case "plan9":
t.Skipf("skipping test on %q", runtime.GOOS) t.Skipf("skipping test on %q", runtime.GOOS)
case "windows": case "windows":
if testing.Short() || !*testExternal {
t.Skipf("skipping test on %q to avoid network firewall", runtime.GOOS)
}
default: default:
if os.Getuid() != 0 { if os.Getuid() != 0 {
t.Skip("skipping test; must be root") t.Skip("skipping test; must be root")
...@@ -158,6 +161,9 @@ func TestPacketConnICMPEcho(t *testing.T) { ...@@ -158,6 +161,9 @@ func TestPacketConnICMPEcho(t *testing.T) {
case "plan9": case "plan9":
t.Skipf("skipping test on %q", runtime.GOOS) t.Skipf("skipping test on %q", runtime.GOOS)
case "windows": case "windows":
if testing.Short() || !*testExternal {
t.Skipf("skipping test on %q to avoid network firewall", runtime.GOOS)
}
default: default:
if os.Getuid() != 0 { if os.Getuid() != 0 {
t.Skip("skipping test; must be root") t.Skip("skipping test; must be root")
......
...@@ -25,6 +25,10 @@ var ipv4MulticastListenerTests = []struct { ...@@ -25,6 +25,10 @@ var ipv4MulticastListenerTests = []struct {
// port. // port.
func TestIPv4MulticastListener(t *testing.T) { func TestIPv4MulticastListener(t *testing.T) {
switch runtime.GOOS { switch runtime.GOOS {
case "windows":
if testing.Short() || !*testExternal {
t.Skipf("skipping test on %q to avoid network firewall", runtime.GOOS)
}
case "plan9": case "plan9":
t.Skipf("skipping test on %q", runtime.GOOS) t.Skipf("skipping test on %q", runtime.GOOS)
} }
......
...@@ -32,6 +32,9 @@ func packetConnTestData(t *testing.T, net string, i int) ([]byte, func()) { ...@@ -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) t.Logf("skipping %q test on %q", net, runtime.GOOS)
} }
case "windows": case "windows":
if testing.Short() || !*testExternal {
t.Skipf("skipping test on %q to avoid network firewall", runtime.GOOS)
}
default: default:
if os.Getuid() != 0 { if os.Getuid() != 0 {
return nil, func() { return nil, func() {
......
...@@ -177,6 +177,9 @@ func TestIPConnSpecificMethods(t *testing.T) { ...@@ -177,6 +177,9 @@ func TestIPConnSpecificMethods(t *testing.T) {
case "plan9": case "plan9":
t.Skipf("skipping test on %q", runtime.GOOS) t.Skipf("skipping test on %q", runtime.GOOS)
case "windows": case "windows":
if testing.Short() || !*testExternal {
t.Skipf("skipping test on %q to avoid network firewall", runtime.GOOS)
}
default: default:
if os.Getuid() != 0 { if os.Getuid() != 0 {
t.Skipf("skipping test; must be root") t.Skipf("skipping test; must be root")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment