Skip to content

Commit 8204a74

Browse files
dmabupttargos
authored andcommitted
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 <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent b18c8d3 commit 8204a74

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

test/common/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ Attempts to 'kill' `pid`
237237

238238
Platform check for Free BSD.
239239

240+
### isIBMi
241+
* [&lt;boolean>][]
242+
243+
Platform check for IBMi.
244+
240245
### isLinux
241246
* [&lt;boolean>][]
242247

test/common/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ if (process.argv.length === 2 &&
102102

103103
const isWindows = process.platform === 'win32';
104104
const isAIX = process.platform === 'aix';
105+
// On IBMi, process.platform and os.platform() both return 'aix',
106+
// It is not enough to differentiate between IBMi and real AIX system.
107+
const isIBMi = os.type() === 'OS400';
105108
const isLinuxPPCBE = (process.platform === 'linux') &&
106109
(process.arch === 'ppc64') &&
107110
(os.endianness() === 'BE');
@@ -762,6 +765,7 @@ module.exports = {
762765
isAIX,
763766
isAlive,
764767
isFreeBSD,
768+
isIBMi,
765769
isLinux,
766770
isLinuxPPCBE,
767771
isMainThread,

test/common/index.mjs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const {
1010
isMainThread,
1111
isWindows,
1212
isAIX,
13+
isIBMi,
1314
isLinuxPPCBE,
1415
isSunOS,
1516
isFreeBSD,
@@ -56,6 +57,7 @@ export {
5657
isMainThread,
5758
isWindows,
5859
isAIX,
60+
isIBMi,
5961
isLinuxPPCBE,
6062
isSunOS,
6163
isFreeBSD,

test/parallel/test-cluster-bind-privileged-port.js

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ const common = require('../common');
2626
if (common.isOSX)
2727
common.skip('macOS may allow ordinary processes to use any port');
2828

29+
if (common.isIBMi)
30+
common.skip('IBMi may allow ordinary processes to use any port');
31+
2932
if (common.isWindows)
3033
common.skip('not reliable on Windows.');
3134

0 commit comments

Comments
 (0)