Skip to content

Commit

Permalink
test: fix test-net-autoselectfamily for kernel without IPv6 support
Browse files Browse the repository at this point in the history
PR-URL: #45856
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
  • Loading branch information
LiviaMedeiros authored and MylesBorins committed Feb 20, 2023
1 parent f192b83 commit 6ad01fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/parallel/test-net-autoselectfamily.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ if (common.hasIPv6) {
if (common.hasIPv6) {
assert.strictEqual(error.code, 'ECONNREFUSED');
assert.strictEqual(error.message, `connect ECONNREFUSED ::1:${port}`);
} else if (error.code === 'EAFNOSUPPORT') {
assert.strictEqual(error.message, `connect EAFNOSUPPORT ::1:${port} - Local (undefined:undefined)`);
} else {
assert.strictEqual(error.code, 'EADDRNOTAVAIL');
assert.strictEqual(error.message, `connect EADDRNOTAVAIL ::1:${port} - Local (:::0)`);
Expand Down
2 changes: 2 additions & 0 deletions test/parallel/test-net-autoselectfamilydefault.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ function createDnsServer(ipv6Addr, ipv4Addr, cb) {
if (common.hasIPv6) {
assert.strictEqual(error.code, 'ECONNREFUSED');
assert.strictEqual(error.message, `connect ECONNREFUSED ::1:${port}`);
} else if (error.code === 'EAFNOSUPPORT') {
assert.strictEqual(error.message, `connect EAFNOSUPPORT ::1:${port} - Local (undefined:undefined)`);
} else {
assert.strictEqual(error.code, 'EADDRNOTAVAIL');
assert.strictEqual(error.message, `connect EADDRNOTAVAIL ::1:${port} - Local (:::0)`);
Expand Down

0 comments on commit 6ad01fd

Please sign in to comment.