Skip to content

Commit

Permalink
test: accept EPROTONOSUPPORT ipv6 error
Browse files Browse the repository at this point in the history
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: #733
Reviewed-By: Fedor Indutny <fedor@indutny.com>
  • Loading branch information
bnoordhuis committed Feb 5, 2015
1 parent 05f4dff commit 62512bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-dgram-error-message-address.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}));

Expand Down

0 comments on commit 62512bb

Please sign in to comment.