Skip to content

Commit 035e063

Browse files
richardlaunodejs-github-bot
authored andcommitted
test: disambiguate AIX and IBM i
When built with Python 3.9 on IBM i, `process.platform` will return `os400` instead of `aix`. In preparation for this, make `common.isAIX` only return true for AIX and update the tests to add checks for `common.isIBMi` where they were missing. PR-URL: #48056 Refs: #46739 Refs: nodejs/build#3358 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 53b5545 commit 035e063

13 files changed

+25
-18
lines changed

test/abort/test-addon-uv-handle-leak.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ if (process.argv[2] === 'child') {
7878

7979
if (!(common.isFreeBSD ||
8080
common.isAIX ||
81+
common.isIBMi ||
8182
(common.isLinux && !isGlibc()) ||
8283
common.isWindows)) {
8384
assert(stderr.includes('ExampleOwnerClass'), stderr);

test/common/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ if (process.argv.length === 2 &&
123123
}
124124

125125
const isWindows = process.platform === 'win32';
126-
const isAIX = process.platform === 'aix';
127126
const isSunOS = process.platform === 'sunos';
128127
const isFreeBSD = process.platform === 'freebsd';
129128
const isOpenBSD = process.platform === 'openbsd';
@@ -274,7 +273,7 @@ function platformTimeout(ms) {
274273
if (process.features.debug)
275274
ms = multipliers.two * ms;
276275

277-
if (isAIX)
276+
if (exports.isAIX || exports.isIBMi)
278277
return multipliers.two * ms; // Default localhost speed is slower on AIX
279278

280279
if (isPi)
@@ -928,7 +927,6 @@ const common = {
928927
hasQuic,
929928
hasMultiLocalhost,
930929
invalidArgTypeHelper,
931-
isAIX,
932930
isAlive,
933931
isAsan,
934932
isDumbTerminal,
@@ -999,7 +997,12 @@ const common = {
999997
},
1000998

1001999
// On IBMi, process.platform and os.platform() both return 'aix',
1000+
// when built with Python versions earlier than 3.9.
10021001
// It is not enough to differentiate between IBMi and real AIX system.
1002+
get isAIX() {
1003+
return require('os').type() === 'AIX';
1004+
},
1005+
10031006
get isIBMi() {
10041007
return require('os').type() === 'OS400';
10051008
},

test/known_issues/test-cwd-enoent-file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
const common = require('../common');
66
const assert = require('assert');
77

8-
if (common.isSunOS || common.isWindows || common.isAIX) {
8+
if (common.isSunOS || common.isWindows || common.isAIX || common.isIBMi) {
99
// The current working directory cannot be removed on these platforms.
1010
// Change this to common.skip() when this is no longer a known issue test.
1111
assert.fail('cannot rmdir current working directory');

test/parallel/test-cwd-enoent-preload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const common = require('../common');
33
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
4-
if (common.isSunOS || common.isWindows || common.isAIX)
4+
if (common.isSunOS || common.isWindows || common.isAIX || common.isIBMi)
55
common.skip('cannot rmdir current working directory');
66
if (!common.isMainThread)
77
common.skip('process.chdir is not available in Workers');

test/parallel/test-cwd-enoent-repl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const common = require('../common');
33
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
4-
if (common.isSunOS || common.isWindows || common.isAIX)
4+
if (common.isSunOS || common.isWindows || common.isAIX || common.isIBMi)
55
common.skip('cannot rmdir current working directory');
66
if (!common.isMainThread)
77
common.skip('process.chdir is not available in Workers');

test/parallel/test-cwd-enoent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const common = require('../common');
33
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
4-
if (common.isSunOS || common.isWindows || common.isAIX)
4+
if (common.isSunOS || common.isWindows || common.isAIX || common.isIBMi)
55
common.skip('cannot rmdir current working directory');
66
if (!common.isMainThread)
77
common.skip('process.chdir is not available in Workers');

test/parallel/test-fs-readfile-pipe-large.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const common = require('../common');
33

44
// Simulate `cat readfile.js | node readfile.js`
55

6-
if (common.isWindows || common.isAIX)
6+
if (common.isWindows || common.isAIX || common.isIBMi)
77
common.skip(`No /dev/stdin on ${process.platform}.`);
88

99
const assert = require('assert');

test/parallel/test-fs-readfile-pipe.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const common = require('../common');
2424

2525
// Simulate `cat readfile.js | node readfile.js`
2626

27-
if (common.isWindows || common.isAIX)
27+
if (common.isWindows || common.isAIX || common.isIBMi)
2828
common.skip(`No /dev/stdin on ${process.platform}.`);
2929

3030
const assert = require('assert');

test/parallel/test-fs-readfilesync-pipe-large.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const common = require('../common');
33

44
// Simulate `cat readfile.js | node readfile.js`
55

6-
if (common.isWindows || common.isAIX)
6+
if (common.isWindows || common.isAIX || common.isIBMi)
77
common.skip(`No /dev/stdin on ${process.platform}.`);
88

99
const assert = require('assert');

test/parallel/test-fs-realpath-pipe.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const common = require('../common');
44

5-
if (common.isWindows || common.isAIX)
5+
if (common.isWindows || common.isAIX || common.isIBMi)
66
common.skip(`No /dev/stdin on ${process.platform}.`);
77

88
const assert = require('assert');

0 commit comments

Comments
 (0)