Skip to content

Commit

Permalink
test: added checks for command existence before running nat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emmacasolin committed Jun 10, 2022
1 parent 96a1688 commit 438fa0b
Show file tree
Hide file tree
Showing 5 changed files with 249 additions and 228 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
"node-gyp-build": "4.4.0",
"pkg": "5.6.0",
"prettier": "^2.6.2",
"shelljs": "^0.8.5",
"shx": "^0.3.4",
"ts-jest": "^27.0.5",
"ts-node": "^10.4.0",
Expand Down
7 changes: 6 additions & 1 deletion tests/nat/endpointDependentNAT.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ import os from 'os';
import path from 'path';
import fs from 'fs';
import process from 'process';
import shell from 'shelljs';
import Logger, { LogLevel, StreamHandler } from '@matrixai/logger';
import * as testNatUtils from './utils';
import { describeIf } from '../utils';

describeIf(
process.platform === 'linux',
process.platform === 'linux' &&
shell.which('ip') &&
shell.which('iptables') &&
shell.which('nsenter') &&
shell.which('unshare'),
'endpoint dependent NAT traversal',
() => {
const logger = new Logger('EDM NAT test', LogLevel.WARN, [
Expand Down
7 changes: 6 additions & 1 deletion tests/nat/endpointIndependentNAT.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ import os from 'os';
import path from 'path';
import fs from 'fs';
import process from 'process';
import shell from 'shelljs';
import Logger, { LogLevel, StreamHandler } from '@matrixai/logger';
import * as testNatUtils from './utils';
import { describeIf } from '../utils';

describeIf(
process.platform === 'linux',
process.platform === 'linux' &&
shell.which('ip') &&
shell.which('iptables') &&
shell.which('nsenter') &&
shell.which('unshare'),
'endpoint independent NAT traversal',
() => {
const logger = new Logger('EIM NAT test', LogLevel.WARN, [
Expand Down
Loading

0 comments on commit 438fa0b

Please sign in to comment.