Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't listen on all interfaces in tests, unless on CI #136

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 22 additions & 17 deletions net/net_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,23 +232,28 @@ func TestListenAddrs(t *testing.T) {
test("/ip4/127.0.0.1/tcp/4324", "", true)
test("/ip4/127.0.0.1/udp/4325", "", false)
test("/ip4/127.0.0.1/udp/4326/udt", "", false)
test("/ip4/0.0.0.0/tcp/4324", "", true)
test("/ip4/0.0.0.0/udp/4325", "", false)
test("/ip4/0.0.0.0/udp/4326/udt", "", false)

test("/ip6/::1/tcp/4324", "", true)
test("/ip6/::1/udp/4325", "", false)
test("/ip6/::1/udp/4326/udt", "", false)
test("/ip6/::/tcp/4324", "", true)
test("/ip6/::/udp/4325", "", false)
test("/ip6/::/udp/4326/udt", "", false)

/* "An implementation should also support the concept of a "default"
* zone for each scope. And, when supported, the index value zero
* at each scope SHOULD be reserved to mean "use the default zone"."
* -- rfc4007. So, this _should_ work everywhere(?). */
test("/ip6zone/0/ip6/::1/tcp/4324", "/ip6/::1/tcp/4324", true)
test("/ip6zone/0/ip6/::1/udp/4324", "", false)

if len(os.Getenv("CI")) > 0 {
marten-seemann marked this conversation as resolved.
Show resolved Hide resolved
test("/ip4/0.0.0.0/tcp/4324", "", true)
test("/ip4/0.0.0.0/udp/4325", "", false)
test("/ip4/0.0.0.0/udp/4326/udt", "", false)

test("/ip6/::1/tcp/4324", "", true)
test("/ip6/::1/udp/4325", "", false)
test("/ip6/::1/udp/4326/udt", "", false)
test("/ip6/::/tcp/4324", "", true)
test("/ip6/::/udp/4325", "", false)
test("/ip6/::/udp/4326/udt", "", false)

/* "An implementation should also support the concept of a "default"
* zone for each scope. And, when supported, the index value zero
* at each scope SHOULD be reserved to mean "use the default zone"."
* -- rfc4007. So, this _should_ work everywhere(?). */
test("/ip6zone/0/ip6/::1/tcp/4324", "/ip6/::1/tcp/4324", true)
test("/ip6zone/0/ip6/::1/udp/4324", "", false)
} else {
t.Skip("all tests only run on CI")
}
}

func TestListenAndDial(t *testing.T) {
Expand Down