Skip to content

Commit 62512bb

Browse files
committed
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: #733 Reviewed-By: Fedor Indutny <[email protected]>
1 parent 05f4dff commit 62512bb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/parallel/test-dgram-error-message-address.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ var family_ipv6 = 'IPv6';
2424
socket_ipv6.on('listening', assert.fail);
2525

2626
socket_ipv6.on('error', common.mustCall(function(e) {
27-
// EAFNOSUPPORT means IPv6 is disabled on this system.
28-
var code = (e.code === 'EADDRNOTAVAIL' ? e.code : 'EAFNOSUPPORT');
29-
assert.equal(e.message, 'bind ' + code + ' 111::1:' + common.PORT);
27+
// EAFNOSUPPORT or EPROTONOSUPPORT means IPv6 is disabled on this system.
28+
var allowed = ['EADDRNOTAVAIL', 'EAFNOSUPPORT', 'EPROTONOSUPPORT'];
29+
assert.notEqual(allowed.indexOf(e.code), -1);
30+
assert.equal(e.message, 'bind ' + e.code + ' 111::1:' + common.PORT);
3031
assert.equal(e.address, '111::1');
3132
assert.equal(e.port, common.PORT);
32-
assert.equal(e.code, code);
3333
socket_ipv6.close();
3434
}));
3535

0 commit comments

Comments
 (0)