diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2015-02-05 23:52:33 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2015-02-06 00:49:00 +0100 |
commit | 62512bb29cd000dd5ce848258c10f3211f153bd5 (patch) | |
tree | 5e3910de6e5b9367473a61f9604f882fd9918a77 /test/parallel/test-dgram-error-message-address.js | |
parent | 05f4dff97519ada5d3149a16ca9e5a04df948a61 (diff) | |
download | android-node-v8-62512bb29cd000dd5ce848258c10f3211f153bd5.tar.gz android-node-v8-62512bb29cd000dd5ce848258c10f3211f153bd5.tar.bz2 android-node-v8-62512bb29cd000dd5ce848258c10f3211f153bd5.zip |
test: accept EPROTONOSUPPORT ipv6 error
The IPv6 test in parallel/test-dgram-error-message-address may fail
when the host system has disabled IPv6, as is the case on our FreeBSD
machines. The test already accepted EAFNOSUPPORT as of commit 5ba307a,
now make it accept EPROTONOSUPPORT as well.
I'm not exactly thrilled by the profusion of error codes but they are
all legitimate.
PR-URL: https://github.com/iojs/io.js/pull/733
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'test/parallel/test-dgram-error-message-address.js')
-rw-r--r-- | test/parallel/test-dgram-error-message-address.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/parallel/test-dgram-error-message-address.js b/test/parallel/test-dgram-error-message-address.js index f66e86b778..95b1e062e3 100644 --- a/test/parallel/test-dgram-error-message-address.js +++ b/test/parallel/test-dgram-error-message-address.js @@ -24,12 +24,12 @@ var family_ipv6 = 'IPv6'; socket_ipv6.on('listening', assert.fail); socket_ipv6.on('error', common.mustCall(function(e) { - // EAFNOSUPPORT means IPv6 is disabled on this system. - var code = (e.code === 'EADDRNOTAVAIL' ? e.code : 'EAFNOSUPPORT'); - assert.equal(e.message, 'bind ' + code + ' 111::1:' + common.PORT); + // EAFNOSUPPORT or EPROTONOSUPPORT means IPv6 is disabled on this system. + var allowed = ['EADDRNOTAVAIL', 'EAFNOSUPPORT', 'EPROTONOSUPPORT']; + assert.notEqual(allowed.indexOf(e.code), -1); + assert.equal(e.message, 'bind ' + e.code + ' 111::1:' + common.PORT); assert.equal(e.address, '111::1'); assert.equal(e.port, common.PORT); - assert.equal(e.code, code); socket_ipv6.close(); })); |