Skip to content

Commit

Permalink
test: handle EUNATCH on IBM i
Browse files Browse the repository at this point in the history
When IPv6 is disabled IBM i returns EUNATCH (errno 42).
For now, I've added an errno check in test case.
libuv needs to get updated to handle EUNATCH so that
the error code can be addressed as EUNATCH.

This change is related to changes done in
nodejs#46546

At the time this test case was not enabled
  • Loading branch information
abmusse committed May 17, 2023
1 parent 62fd6bc commit 7b86dc9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/parallel/test-net-autoselectfamily-commandline-option.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ function createDnsServer(ipv6Addr, ipv4Addr, cb) {
if (common.hasIPv6) {
assert.strictEqual(error.code, 'ECONNREFUSED');
assert.strictEqual(error.message, `connect ECONNREFUSED ::1:${port}`);
} else if (common.isIBMi) {
// IBMi returns EUNATCH (ERRNO 42) when IPv6 is disabled
// keep this errno assertion until EUNATCH is recognized by libuv
assert.strictEqual(error.errno, -42);
} else {
assert.strictEqual(error.code, 'EADDRNOTAVAIL');
assert.strictEqual(error.message, `connect EADDRNOTAVAIL ::1:${port} - Local (:::0)`);
Expand Down

0 comments on commit 7b86dc9

Please sign in to comment.