diff --git a/test/parallel/test-net-dns-lookup.js b/test/parallel/test-net-dns-lookup.js index 5a40ce5c598bb2..289a1563a52dbe 100644 --- a/test/parallel/test-net-dns-lookup.js +++ b/test/parallel/test-net-dns-lookup.js @@ -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'); })); })); diff --git a/test/parallel/test-net-remote-address-port.js b/test/parallel/test-net-remote-address-port.js index 4ef686a3de7659..47a495c09b55ee 100644 --- a/test/parallel/test-net-remote-address-port.js +++ b/test/parallel/test-net-remote-address-port.js @@ -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'); diff --git a/test/parallel/test-tcp-wrap-listen.js b/test/parallel/test-tcp-wrap-listen.js index 29051481c72583..0cac545e81d785 100644 --- a/test/parallel/test-tcp-wrap-listen.js +++ b/test/parallel/test-tcp-wrap-listen.js @@ -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);