Skip to content
Permalink
Browse files

test: add an indicator `isIBMi`

We have to skip some test cases on IBM i.
On IBM i, process.platform and os.platform() both return aix,
It is not enough to differentiate between IBM i and real AIX system.
Also updated parallel/test-cluster-bind-privileged-port.js for test.

PR-URL: #30714
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
dmabupt authored and MylesBorins committed Nov 29, 2019
1 parent 3b096c2 commit 197b61656d03c8a2a7ef1c4635f909073e400e81
Showing with 14 additions and 0 deletions.
  1. +5 −0 test/common/README.md
  2. +4 −0 test/common/index.js
  3. +2 −0 test/common/index.mjs
  4. +3 −0 test/parallel/test-cluster-bind-privileged-port.js
@@ -237,6 +237,11 @@ Attempts to 'kill' `pid`

Platform check for Free BSD.

### isIBMi
* [&lt;boolean>][]

Platform check for IBMi.

### isLinux
* [&lt;boolean>][]

@@ -102,6 +102,9 @@ if (process.argv.length === 2 &&

const isWindows = process.platform === 'win32';
const isAIX = process.platform === 'aix';
// On IBMi, process.platform and os.platform() both return 'aix',
// It is not enough to differentiate between IBMi and real AIX system.
const isIBMi = os.type() === 'OS400';
const isLinuxPPCBE = (process.platform === 'linux') &&
(process.arch === 'ppc64') &&
(os.endianness() === 'BE');
@@ -762,6 +765,7 @@ module.exports = {
isAIX,
isAlive,
isFreeBSD,
isIBMi,
isLinux,
isLinuxPPCBE,
isMainThread,
@@ -10,6 +10,7 @@ const {
isMainThread,
isWindows,
isAIX,
isIBMi,
isLinuxPPCBE,
isSunOS,
isFreeBSD,
@@ -56,6 +57,7 @@ export {
isMainThread,
isWindows,
isAIX,
isIBMi,
isLinuxPPCBE,
isSunOS,
isFreeBSD,
@@ -26,6 +26,9 @@ const common = require('../common');
if (common.isOSX)
common.skip('macOS may allow ordinary processes to use any port');

if (common.isIBMi)
common.skip('IBMi may allow ordinary processes to use any port');

if (common.isWindows)
common.skip('not reliable on Windows.');

0 comments on commit 197b616

Please sign in to comment.
You can’t perform that action at this time.