Skip to content

Commit

Permalink
test: add an indicator isIBMi
Browse files Browse the repository at this point in the history
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 targos committed Dec 3, 2019
1 parent 0aae502 commit 81d81a5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ Attempts to 'kill' `pid`

Platform check for Free BSD.

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

Platform check for IBMi.

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

Expand Down
4 changes: 4 additions & 0 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -762,6 +765,7 @@ module.exports = {
isAIX,
isAlive,
isFreeBSD,
isIBMi,
isLinux,
isLinuxPPCBE,
isMainThread,
Expand Down
2 changes: 2 additions & 0 deletions test/common/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const {
isMainThread,
isWindows,
isAIX,
isIBMi,
isLinuxPPCBE,
isSunOS,
isFreeBSD,
Expand Down Expand Up @@ -55,6 +56,7 @@ export {
isMainThread,
isWindows,
isAIX,
isIBMi,
isLinuxPPCBE,
isSunOS,
isFreeBSD,
Expand Down
3 changes: 3 additions & 0 deletions test/parallel/test-cluster-bind-privileged-port.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.');

Expand Down

0 comments on commit 81d81a5

Please sign in to comment.