Skip to content

Commit

Permalink
dns: fix test suite, part 3
Browse files Browse the repository at this point in the history
PR-URL: #39987
Fixes: #31566
Refs: #6307
Refs: #20710
Refs: #38099
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
  • Loading branch information
treysis authored and nodejs-github-bot committed Sep 12, 2021
1 parent 6f81a24 commit 89ba902
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion test/parallel/test-net-dns-lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ server.listen(0, common.mustCall(function() {
.on('lookup', common.mustCall(function(err, ip, type, host) {
assert.strictEqual(err, null);
assert.strictEqual(ip, '127.0.0.1');
assert.strictEqual(type, 4);
assert.match(ip,/^(127\.0\.0\.1|::1)$/);
assert.match(type.toString, /^(4|6)$/);
assert.strictEqual(host, 'localhost');
}));
}));
2 changes: 1 addition & 1 deletion test/parallel/test-net-remote-address-port.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const net = require('net');
let conns_closed = 0;

const remoteAddrCandidates = [ common.localhostIPv4 ];
if (common.hasIPv6) remoteAddrCandidates.push('::ffff:127.0.0.1');
if (common.hasIPv6) remoteAddrCandidates.push('::1', '::ffff:127.0.0.1');

const remoteFamilyCandidates = ['IPv4'];
if (common.hasIPv6) remoteFamilyCandidates.push('IPv6');
Expand Down
4 changes: 3 additions & 1 deletion test/parallel/test-tcp-wrap-listen.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const {

const server = new TCP(TCPConstants.SOCKET);

const r = server.bind(0);
const r = (common.hasIPv6 ?
server.bind6('::', 0) :
server.bind('0.0.0.0', 0));
assert.strictEqual(r, 0);
let port = {};
server.getsockname(port);
Expand Down

0 comments on commit 89ba902

Please sign in to comment.