numConns := listenerBacklog + 10
// TODO(bradfitz): It's hard to test this in a portable
- // way. This is unforunate, but works for now.
+ // way. This is unfortunate, but works for now.
switch runtime.GOOS {
case "linux":
// The kernel will start accepting TCP connections before userspace
"time"
)
-// avoidOSXFirewallDialogPopup avoids OS X, former konwn as MacOS X,
-// firewall dialog popups during tests. It looks like OS X checks
-// wildcard listens by default for security reasons. A listen with
-// specific address doesn't make dialog popups for now.
-var avoidOSXFirewallDialogPopup = func() bool {
- return testing.Short() && runtime.GOOS == "darwin"
-}
-
func TestShutdown(t *testing.T) {
if runtime.GOOS == "plan9" {
t.Logf("skipping test on %q", runtime.GOOS)
}
for _, tt := range listenerTests {
- if tt.wildcard && avoidOSXFirewallDialogPopup() {
+ if tt.wildcard && (testing.Short() || !*testExternal) {
continue
}
if tt.ipv6 && !supportsIPv6 {
}
for _, tt := range listenerTests {
- if tt.wildcard && avoidOSXFirewallDialogPopup() {
+ if tt.wildcard && (testing.Short() || !*testExternal) {
continue
}
if tt.ipv6 && !supportsIPv6 {
}
for _, tt := range listenerTests {
- if tt.wildcard && avoidOSXFirewallDialogPopup() {
+ if tt.wildcard && (testing.Short() || !*testExternal) {
continue
}
if tt.ipv6 {
}
for _, tt := range listenerTests {
- if tt.wildcard && avoidOSXFirewallDialogPopup() {
+ if tt.wildcard && (testing.Short() || !*testExternal) {
continue
}
if tt.ipv6 {
}
for _, tt := range dualStackListenerTests {
- if tt.wildcard && avoidOSXFirewallDialogPopup() {
+ if tt.wildcard && (testing.Short() || !*testExternal) {
continue
}
switch runtime.GOOS {
}
for _, tt := range dualStackListenerTests {
- if tt.wildcard && avoidOSXFirewallDialogPopup() {
+ if tt.wildcard && (testing.Short() || !*testExternal) {
continue
}
tt.net1 = toudpnet(tt.net1)
return
}
// This test requires both IPv6 and IPv6 IPv4-mapping functionality.
- if !supportsIPv4map || avoidOSXFirewallDialogPopup() {
+ if !supportsIPv4map || testing.Short() || !*testExternal {
return
}