aboutsummaryrefslogtreecommitdiff
path: root/test/test-tcp-bind6-error.c
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2014-12-29 00:10:45 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2014-12-29 17:14:48 +0100
commita09e77e18082d026ded9bad7452718c6340f1686 (patch)
treec5baa1aa53f328d74f17c3f61ddf72fdf5e5ee1d /test/test-tcp-bind6-error.c
parent9141f48ea551c1538bbab17c44c8f9e8393b5679 (diff)
downloadlibuv-a09e77e18082d026ded9bad7452718c6340f1686.tar.gz
libuv-a09e77e18082d026ded9bad7452718c6340f1686.zip
test: skip ipv6 tests when ipv6 is not supported
To verify on Linux, run `sudo sysctl net.ipv6.conf.all.disable_ipv6=1` before the test suite. Fixes: https://github.com/libuv/libuv/issues/10 PR-URL: https://github.com/libuv/libuv/pull/92 Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Diffstat (limited to 'test/test-tcp-bind6-error.c')
-rw-r--r--test/test-tcp-bind6-error.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test-tcp-bind6-error.c b/test/test-tcp-bind6-error.c
index 1d65f3de..b762bcb3 100644
--- a/test/test-tcp-bind6-error.c
+++ b/test/test-tcp-bind6-error.c
@@ -39,6 +39,9 @@ TEST_IMPL(tcp_bind6_error_addrinuse) {
uv_tcp_t server1, server2;
int r;
+ if (!can_ipv6())
+ RETURN_SKIP("IPv6 not supported");
+
ASSERT(0 == uv_ip6_addr("::", TEST_PORT, &addr));
r = uv_tcp_init(uv_default_loop(), &server1);
@@ -73,6 +76,9 @@ TEST_IMPL(tcp_bind6_error_addrnotavail) {
uv_tcp_t server;
int r;
+ if (!can_ipv6())
+ RETURN_SKIP("IPv6 not supported");
+
ASSERT(0 == uv_ip6_addr("4:4:4:4:4:4:4:4", TEST_PORT, &addr));
r = uv_tcp_init(uv_default_loop(), &server);
@@ -98,6 +104,9 @@ TEST_IMPL(tcp_bind6_error_fault) {
uv_tcp_t server;
int r;
+ if (!can_ipv6())
+ RETURN_SKIP("IPv6 not supported");
+
garbage_addr = (struct sockaddr_in6*) &garbage;
r = uv_tcp_init(uv_default_loop(), &server);
@@ -123,6 +132,9 @@ TEST_IMPL(tcp_bind6_error_inval) {
uv_tcp_t server;
int r;
+ if (!can_ipv6())
+ RETURN_SKIP("IPv6 not supported");
+
ASSERT(0 == uv_ip6_addr("::", TEST_PORT, &addr1));
ASSERT(0 == uv_ip6_addr("::", TEST_PORT_2, &addr2));
@@ -149,6 +161,9 @@ TEST_IMPL(tcp_bind6_localhost_ok) {
uv_tcp_t server;
int r;
+ if (!can_ipv6())
+ RETURN_SKIP("IPv6 not supported");
+
ASSERT(0 == uv_ip6_addr("::1", TEST_PORT, &addr));
r = uv_tcp_init(uv_default_loop(), &server);