Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: skip test if in FreeBSD jail #3995

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion test/parallel/parallel.status
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ test-child-process-exit-code : PASS,FLAKY
[$system==solaris] # Also applies to SmartOS

[$system==freebsd]
test-net-socket-local-address : PASS,FLAKY
20 changes: 13 additions & 7 deletions test/parallel/test-net-socket-local-address.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var net = require('net');
const common = require('../common');
const assert = require('assert');
const net = require('net');

// skip test in FreeBSD jails
if (common.inFreeBSDJail) {
console.log('1..0 # Skipped: In a FreeBSD jail');
return;
}

var conns = 0;
var clientLocalPorts = [];
var serverRemotePorts = [];

var server = net.createServer(function(socket) {
const server = net.createServer(function(socket) {
serverRemotePorts.push(socket.remotePort);
conns++;
});

var client = new net.Socket();
const client = new net.Socket();

server.on('close', function() {
server.on('close', common.mustCall(function() {
assert.deepEqual(clientLocalPorts, serverRemotePorts,
'client and server should agree on the ports used');
assert.equal(2, conns);
});
}));

server.listen(common.PORT, common.localhostIPv4, testConnect);

Expand Down