mirror of https://github.com/nodejs/node.git
test: check for multi-localhost support
parent
d87ae24dfe
commit
2b7c8a2f02
|
@ -210,3 +210,11 @@ exports.mustCall = function(fn, expected) {
|
|||
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;
|
||||
};
|
||||
|
|
|
@ -23,7 +23,7 @@ var common = require('../common');
|
|||
var http = require('http'),
|
||||
assert = require('assert');
|
||||
|
||||
if (['linux', 'win32'].indexOf(process.platform) == -1) {
|
||||
if (!common.hasMultiLocalhost()) {
|
||||
console.log('Skipping platform-specific test.');
|
||||
process.exit();
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ var https = require('https'),
|
|||
fs = require('fs'),
|
||||
assert = require('assert');
|
||||
|
||||
if (['linux', 'win32'].indexOf(process.platform) == -1) {
|
||||
if (!common.hasMultiLocalhost()) {
|
||||
console.log('Skipping platform-specific test.');
|
||||
process.exit();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue