Skip to content

Commit 1939745

Browse files
committed
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: nodejs/node#48056 Refs: nodejs/node#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 20457ac commit 1939745

13 files changed

+25
-18
lines changed

graal-nodejs/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);

graal-nodejs/test/common/index.js

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

121121
const isWindows = process.platform === 'win32';
122-
const isAIX = process.platform === 'aix';
123122
const isSunOS = process.platform === 'sunos';
124123
const isFreeBSD = process.platform === 'freebsd';
125124
const isOpenBSD = process.platform === 'openbsd';
@@ -263,7 +262,7 @@ function platformTimeout(ms) {
263262
if (process.features.debug)
264263
ms = multipliers.two * ms;
265264

266-
if (isAIX)
265+
if (exports.isAIX || exports.isIBMi)
267266
return multipliers.two * ms; // Default localhost speed is slower on AIX
268267

269268
if (isPi)
@@ -903,7 +902,6 @@ const common = {
903902
hasQuic,
904903
hasMultiLocalhost,
905904
invalidArgTypeHelper,
906-
isAIX,
907905
isAlive,
908906
isAsan,
909907
isDumbTerminal,
@@ -967,7 +965,12 @@ const common = {
967965
},
968966

969967
// On IBMi, process.platform and os.platform() both return 'aix',
968+
// when built with Python versions earlier than 3.9.
970969
// It is not enough to differentiate between IBMi and real AIX system.
970+
get isAIX() {
971+
return require('os').type() === 'AIX';
972+
},
973+
971974
get isIBMi() {
972975
return require('os').type() === 'OS400';
973976
},

graal-nodejs/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');

graal-nodejs/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');

graal-nodejs/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');

graal-nodejs/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');

graal-nodejs/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');

graal-nodejs/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');

graal-nodejs/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');

graal-nodejs/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)