test: apply Linux workaround to Linux only
authorRich Trott <rtrott@gmail.com>
Sun, 28 Feb 2016 06:18:22 +0000 (22:18 -0800)
committerMyles Borins <mborins@us.ibm.com>
Mon, 21 Mar 2016 20:06:59 +0000 (13:06 -0700)
Do not try Ubuntu/SUSE/Debian-specific hostnames for IPv6 localhost
unless we are on Linux.

Fixes: https://github.com/nodejs/node/issues/4546
PR-URL: https://github.com/nodejs/node/pull/5471
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Ben Noorhduis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
test/common.js

index 187d26a..9691509 100644 (file)
@@ -80,18 +80,21 @@ var opensslCli = null;
 var inFreeBSDJail = null;
 var localhostIPv4 = null;
 
-exports.localIPv6Hosts = [
-  // Debian/Ubuntu
-  'ip6-localhost',
-  'ip6-loopback',
-
-  // SUSE
-  'ipv6-localhost',
-  'ipv6-loopback',
-
-  // Typically universal
-  'localhost',
-];
+exports.localIPv6Hosts = ['localhost'];
+if (process.platform === 'linux') {
+  exports.localIPv6Hosts = [
+    // Debian/Ubuntu
+    'ip6-localhost',
+    'ip6-loopback',
+
+    // SUSE
+    'ipv6-localhost',
+    'ipv6-loopback',
+
+    // Typically universal
+    'localhost',
+  ];
+}
 
 Object.defineProperty(exports, 'inFreeBSDJail', {
   get: function() {