diff options
author | Fedor Indutny <fedor@indutny.com> | 2014-08-02 12:42:42 +0400 |
---|---|---|
committer | Timothy J Fontaine <tjfontaine@gmail.com> | 2014-08-13 11:43:58 -0700 |
commit | c7b42fe2e5342c903cf36351d1d13b9d43261b70 (patch) | |
tree | 5418c9bce085886092b0d30eba2005584bcc50ea /test/simple | |
parent | f5f5bd76e6e4791d1098cc71c0d8927fdf34d318 (diff) | |
download | node-new-c7b42fe2e5342c903cf36351d1d13b9d43261b70.tar.gz |
test: check ipv6 support before testing it
fix #7983
fix #8049
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
Diffstat (limited to 'test/simple')
-rw-r--r-- | test/simple/test-dgram-bind-default-address.js | 5 | ||||
-rw-r--r-- | test/simple/test-net-connect-options-ipv6.js | 5 | ||||
-rw-r--r-- | test/simple/test-net-pingpong.js | 8 | ||||
-rw-r--r-- | test/simple/test-net-server-address.js | 5 |
4 files changed, 21 insertions, 2 deletions
diff --git a/test/simple/test-dgram-bind-default-address.js b/test/simple/test-dgram-bind-default-address.js index ae1b472a08..e7b65c57bf 100644 --- a/test/simple/test-dgram-bind-default-address.js +++ b/test/simple/test-dgram-bind-default-address.js @@ -29,6 +29,11 @@ dgram.createSocket('udp4').bind(common.PORT + 0, common.mustCall(function() { this.close(); })); +if (!common.hasIPv6) { + console.error('Skipping udp6 part of test, no IPv6 support'); + return; +} + dgram.createSocket('udp6').bind(common.PORT + 1, common.mustCall(function() { assert.equal(this.address().port, common.PORT + 1); var address = this.address().address; diff --git a/test/simple/test-net-connect-options-ipv6.js b/test/simple/test-net-connect-options-ipv6.js index 6e4023b72a..9dd60c1cbd 100644 --- a/test/simple/test-net-connect-options-ipv6.js +++ b/test/simple/test-net-connect-options-ipv6.js @@ -24,6 +24,11 @@ var assert = require('assert'); var net = require('net'); var dns = require('dns'); +if (!common.hasIPv6) { + console.error('Skipping test, no IPv6 support'); + return; +} + var serverGotEnd = false; var clientGotEnd = false; diff --git a/test/simple/test-net-pingpong.js b/test/simple/test-net-pingpong.js index 1e7b6681ab..ff7c97a03e 100644 --- a/test/simple/test-net-pingpong.js +++ b/test/simple/test-net-pingpong.js @@ -135,9 +135,13 @@ console.log(common.PIPE); pingPongTest(common.PIPE); pingPongTest(common.PORT); pingPongTest(common.PORT + 1, 'localhost'); -pingPongTest(common.PORT + 2, '::1'); +if (common.hasIPv6) + pingPongTest(common.PORT + 2, '::1'); process.on('exit', function() { - assert.equal(4, tests_run); + if (common.hasIPv6) + assert.equal(4, tests_run); + else + assert.equal(3, tests_run); console.log('done'); }); diff --git a/test/simple/test-net-server-address.js b/test/simple/test-net-server-address.js index 671305f662..cc8fbd211a 100644 --- a/test/simple/test-net-server-address.js +++ b/test/simple/test-net-server-address.js @@ -57,6 +57,11 @@ server_ipv6.listen(common.PORT, localhost_ipv6, function() { server_ipv6.close(); }); +if (!common.hasIPv6) { + console.error('Skipping ipv6 part of test, no IPv6 support'); + return; +} + // Test without hostname or ip var anycast_ipv6 = '::'; var server1 = net.createServer(); |