Skip to content

Commit a051a05

Browse files
authored
Merge pull request #136 from marten-seemann/dont-listen-on-all-interfaces
don't listen on all interfaces in tests, unless on CI
2 parents 7274874 + 8c84127 commit a051a05

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

net/net_test.go

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -232,23 +232,28 @@ func TestListenAddrs(t *testing.T) {
232232
test("/ip4/127.0.0.1/tcp/4324", "", true)
233233
test("/ip4/127.0.0.1/udp/4325", "", false)
234234
test("/ip4/127.0.0.1/udp/4326/udt", "", false)
235-
test("/ip4/0.0.0.0/tcp/4324", "", true)
236-
test("/ip4/0.0.0.0/udp/4325", "", false)
237-
test("/ip4/0.0.0.0/udp/4326/udt", "", false)
238-
239-
test("/ip6/::1/tcp/4324", "", true)
240-
test("/ip6/::1/udp/4325", "", false)
241-
test("/ip6/::1/udp/4326/udt", "", false)
242-
test("/ip6/::/tcp/4324", "", true)
243-
test("/ip6/::/udp/4325", "", false)
244-
test("/ip6/::/udp/4326/udt", "", false)
245-
246-
/* "An implementation should also support the concept of a "default"
247-
* zone for each scope. And, when supported, the index value zero
248-
* at each scope SHOULD be reserved to mean "use the default zone"."
249-
* -- rfc4007. So, this _should_ work everywhere(?). */
250-
test("/ip6zone/0/ip6/::1/tcp/4324", "/ip6/::1/tcp/4324", true)
251-
test("/ip6zone/0/ip6/::1/udp/4324", "", false)
235+
236+
if len(os.Getenv("CI")) > 0 {
237+
test("/ip4/0.0.0.0/tcp/4324", "", true)
238+
test("/ip4/0.0.0.0/udp/4325", "", false)
239+
test("/ip4/0.0.0.0/udp/4326/udt", "", false)
240+
241+
test("/ip6/::1/tcp/4324", "", true)
242+
test("/ip6/::1/udp/4325", "", false)
243+
test("/ip6/::1/udp/4326/udt", "", false)
244+
test("/ip6/::/tcp/4324", "", true)
245+
test("/ip6/::/udp/4325", "", false)
246+
test("/ip6/::/udp/4326/udt", "", false)
247+
248+
/* "An implementation should also support the concept of a "default"
249+
* zone for each scope. And, when supported, the index value zero
250+
* at each scope SHOULD be reserved to mean "use the default zone"."
251+
* -- rfc4007. So, this _should_ work everywhere(?). */
252+
test("/ip6zone/0/ip6/::1/tcp/4324", "/ip6/::1/tcp/4324", true)
253+
test("/ip6zone/0/ip6/::1/udp/4324", "", false)
254+
} else {
255+
t.Skip("all tests only run on CI")
256+
}
252257
}
253258

254259
func TestListenAndDial(t *testing.T) {

0 commit comments

Comments
 (0)