Browse Source

test: check for multi-localhost support

v0.10.33-release
Timothy J Fontaine 10 years ago
parent
commit
2b7c8a2f02
  1. 8
      test/common.js
  2. 2
      test/simple/test-http-localaddress.js
  3. 2
      test/simple/test-https-localaddress.js

8
test/common.js

@ -210,3 +210,11 @@ exports.mustCall = function(fn, expected) {
return fn.apply(this, arguments); return fn.apply(this, arguments);
}; };
}; };
exports.hasMultiLocalhost = function hasMultiLocalhost() {
var TCP = process.binding('tcp_wrap').TCP;
var t = new TCP();
var ret = t.bind('127.0.0.2', exports.PORT);
t.close();
return ret === 0;
};

2
test/simple/test-http-localaddress.js

@ -23,7 +23,7 @@ var common = require('../common');
var http = require('http'), var http = require('http'),
assert = require('assert'); assert = require('assert');
if (['linux', 'win32'].indexOf(process.platform) == -1) { if (!common.hasMultiLocalhost()) {
console.log('Skipping platform-specific test.'); console.log('Skipping platform-specific test.');
process.exit(); process.exit();
} }

2
test/simple/test-https-localaddress.js

@ -24,7 +24,7 @@ var https = require('https'),
fs = require('fs'), fs = require('fs'),
assert = require('assert'); assert = require('assert');
if (['linux', 'win32'].indexOf(process.platform) == -1) { if (!common.hasMultiLocalhost()) {
console.log('Skipping platform-specific test.'); console.log('Skipping platform-specific test.');
process.exit(); process.exit();
} }

Loading…
Cancel
Save