test: fix test-net-pingpong pummel test for non-IPv6 hosts

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 <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
pull/34359/head
Rich Trott 2020-07-14 06:32:17 -07:00
parent a55b77d2d3
commit 5487054225
1 changed files with 2 additions and 3 deletions

View File

@ -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);
});