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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Xu Meng 2019-11-29 02:28:49 -06:00 committed by Richard Lau
parent 3b484edce3
commit f0a31e5eb9
No known key found for this signature in database
GPG Key ID: C43CEC45C17AB93C
4 changed files with 14 additions and 0 deletions

View File

@ -237,6 +237,11 @@ Attempts to 'kill' `pid`
Platform check for Free BSD.
### isIBMi
* [&lt;boolean>][]
Platform check for IBMi.
### isLinux
* [&lt;boolean>][]

View File

@ -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,

View File

@ -9,6 +9,7 @@ const {
isMainThread,
isWindows,
isAIX,
isIBMi,
isLinuxPPCBE,
isSunOS,
isFreeBSD,
@ -55,6 +56,7 @@ export {
isMainThread,
isWindows,
isAIX,
isIBMi,
isLinuxPPCBE,
isSunOS,
isFreeBSD,

View File

@ -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.');