From 5e491e7766a3f0980a65329a072a0ada72767fcd Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Wed, 16 Aug 2017 18:41:33 +0200 Subject: [PATCH 1/2] test, win: fix IPv6 detection on Windows Add proper IPv6 detection on loopback device on Windows. PR-URL: https://github.com/nodejs/node/pull/14865 Reviewed-By: James M Snell Reviewed-By: Refael Ackermann --- test/common/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/common/index.js b/test/common/index.js index 8175474818b9dc..57058271f9c19e 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -262,7 +262,7 @@ Object.defineProperty(exports, 'hasFipsCrypto', { { const iFaces = os.networkInterfaces(); - const re = /lo/; + const re = exports.isWindows ? /Loopback Pseudo-Interface/ : /lo/; exports.hasIPv6 = Object.keys(iFaces).some(function(name) { return re.test(name) && iFaces[name].some(function(info) { return info.family === 'IPv6'; From 59a2128d14f8cb76d81efbb860fc8bada2d6c4ed Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Thu, 17 Aug 2017 19:18:06 +0200 Subject: [PATCH 2/2] test: fix async-hooks tests The 'test-graph.tcp' and 'test-tcpwrap' tests are using '::' as server address. This is mapped to localhost on Linux, but fails on Windows. PR-URL: https://github.com/nodejs/node/pull/14865 Reviewed-By: James M Snell Reviewed-By: Refael Ackermann --- test/async-hooks/test-graph.tcp.js | 2 +- test/async-hooks/test-tcpwrap.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/async-hooks/test-graph.tcp.js b/test/async-hooks/test-graph.tcp.js index 872615990733cc..2e0b387cbeaff4 100644 --- a/test/async-hooks/test-graph.tcp.js +++ b/test/async-hooks/test-graph.tcp.js @@ -17,7 +17,7 @@ const server = net server.listen(common.PORT); -net.connect({ port: server.address().port, host: server.address().address }, +net.connect({ port: server.address().port, host: '::1' }, common.mustCall(onconnected)); function onlistening() {} diff --git a/test/async-hooks/test-tcpwrap.js b/test/async-hooks/test-tcpwrap.js index b4021753a072ed..1f4fc6af0d6b5f 100644 --- a/test/async-hooks/test-tcpwrap.js +++ b/test/async-hooks/test-tcpwrap.js @@ -38,7 +38,7 @@ const server = net // Calling net.connect creates another TCPWRAP synchronously { net.connect( - { port: server.address().port, host: server.address().address }, + { port: server.address().port, host: '::1' }, common.mustCall(onconnected)); const tcps = hooks.activitiesOfTypes('TCPWRAP'); assert.strictEqual(tcps.length, 2);