From ec1393db631de21eddc945e5e3a0e8aad72a9ad1 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 14 Jul 2020 06:32:17 -0700 Subject: [PATCH] test: fix test-net-pingpong pummel test for non-IPv6 hosts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use `common.hasIPv6` instead of an OS check for more reliable operation. PR-URL: https://github.com/nodejs/node/pull/34359 Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater Reviewed-By: Tobias Nießen --- test/pummel/test-net-pingpong.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/pummel/test-net-pingpong.js b/test/pummel/test-net-pingpong.js index f21160a1fa2a4d..0b2947ade41a1c 100644 --- a/test/pummel/test-net-pingpong.js +++ b/test/pummel/test-net-pingpong.js @@ -113,9 +113,8 @@ function pingPongTest(host, on_complete) { pingPongTest('localhost'); pingPongTest(null); -// This IPv6 isn't working on Solaris. -if (!common.isSunOS) pingPongTest('::1'); +if (common.hasIPv6) pingPongTest('::1'); process.on('exit', function() { - assert.strictEqual(tests_run, common.isSunOS ? 2 : 3); + assert.strictEqual(tests_run, common.hasIPv6 ? 3 : 2); });