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: add an indicator isIBMi #30714

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
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.
  • Loading branch information
dmabupt committed Dec 1, 2019
commit 1cf3c57685d21605b04dcc63ca8c3475ea831cf0
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
* [<boolean>][]

Platform check for IBMi.

### isLinux
* [<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