Skip to content

Commit

Permalink
tests: Try harder to figure out whether IPv6 is supported.
Browse files Browse the repository at this point in the history
Until now, the tests have tried to create an IPv6 socket to figure out
whether the system under test supports IPv6.  Recently we've seen test
failures on Travis which appear to be because, although the system supports
IPv6, test programs are not allowed to connect or bind IPv6 addresses.
This commit refines the test for IPv6 to also try to bind the IPv6
localhost address, which should convert the test failures to "skip"s.

Acked-by: William Tu <[email protected]>
Reviewed-by: Greg Rose <[email protected]>
Tested-at: https://travis-ci.org/gvrose8192/ovs-experimental
Reported-at: travis-ci/travis-ci#8711
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
blp committed Nov 14, 2017
1 parent b0bf5ef commit 1f3c6b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/atlocal.in
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ FreeBSD|NetBSD)
esac

# Check whether to run IPv6 tests.
if perl -e 'use Socket; socket(FH, PF_INET6, SOCK_STREAM, 0) || exit 1;'; then
if perl -e '
use Socket qw(PF_INET6 SOCK_STREAM pack_sockaddr_in6 IN6ADDR_LOOPBACK);
socket(S, PF_INET6, SOCK_STREAM, 0) || exit 1;
bind(S, pack_sockaddr_in6(0, IN6ADDR_LOOPBACK)) || exit 1;
'; then
HAVE_IPV6=yes
else
HAVE_IPV6=no
Expand Down

0 comments on commit 1f3c6b2

Please sign in to comment.