Skip to content

Commit e28e873

Browse files
dmabuptBridgeAR
authored andcommitted
test: skip the unsupported test cases for IBM i
This is a following PR of #30714. PR-URL: #30819 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 60dd183 commit e28e873

29 files changed

+108
-21
lines changed

test/async-hooks/test-fseventwrap.js

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ const fs = require('fs');
1010
if (!common.isMainThread)
1111
common.skip('Worker bootstrapping works differently -> different async IDs');
1212

13+
if (common.isIBMi)
14+
common.skip('IBMi does not suppport fs.watch()');
15+
1316
const hooks = initHooks();
1417

1518
hooks.enable();

test/parallel/parallel.status

+9
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,12 @@ test-async-hooks-http-parser-destroy: PASS,FLAKY
3939
[$system==freebsd]
4040

4141
[$system==aix]
42+
43+
[$system==ibmi]
44+
# https://github.com/nodejs/node/pull/30819
45+
test-child-process-fork-net-server: SKIP
46+
test-cli-node-options: SKIP
47+
test-cluster-shared-leak: SKIP
48+
test-http-writable-true-after-close: SKIP
49+
test-http2-connect-method: SKIP
50+
test-net-error-twice: SKIP

test/parallel/test-c-ares.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ dns.lookup('::1', common.mustCall((error, result, addressType) => {
8585
// Windows doesn't usually have an entry for localhost 127.0.0.1 in
8686
// C:\Windows\System32\drivers\etc\hosts
8787
// so we disable this test on Windows.
88-
if (!common.isWindows) {
88+
// IBMi reports `ENOTFOUND` when get hostname by address 127.0.0.1
89+
if (!common.isWindows && !common.isIBMi) {
8990
dns.reverse('127.0.0.1', common.mustCall(function(error, domains) {
9091
assert.ifError(error);
9192
assert.ok(Array.isArray(domains));

test/parallel/test-child-process-spawnsync-validation-errors.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ const common = require('../common');
33
const assert = require('assert');
44
const spawnSync = require('child_process').spawnSync;
55
const signals = require('os').constants.signals;
6-
const rootUser = common.isWindows ? false : process.getuid() === 0;
6+
const rootUser = common.isWindows ? false :
7+
common.isIBMi ? true : process.getuid() === 0;
78

89
const invalidArgTypeError = common.expectsError(
910
{ code: 'ERR_INVALID_ARG_TYPE', type: TypeError },

test/parallel/test-child-process-uid-gid.js

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ const assert = require('assert');
44
const spawn = require('child_process').spawn;
55
const expectedError = common.isWindows ? /\bENOTSUP\b/ : /\bEPERM\b/;
66

7+
if (common.isIBMi)
8+
common.skip('IBMi has a different behavior');
9+
710
if (common.isWindows || process.getuid() !== 0) {
811
assert.throws(() => {
912
spawn('echo', ['fhqwhgads'], { uid: 0 });

test/parallel/test-cluster-shared-handle-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

test/parallel/test-fs-access.js

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ const common = require('../common');
88
if (!common.isWindows && process.getuid() === 0)
99
common.skip('as this test should not be run as `root`');
1010

11+
if (common.isIBMi)
12+
common.skip('IBMi has a different access permission mechanism');
13+
1114
const assert = require('assert');
1215
const fs = require('fs');
1316
const path = require('path');

test/parallel/test-fs-copyfile-respect-permissions.js

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ const common = require('../common');
88
if (!common.isWindows && process.getuid() === 0)
99
common.skip('as this test should not be run as `root`');
1010

11+
if (common.isIBMi)
12+
common.skip('IBMi has a different access permission mechanism');
13+
1114
const tmpdir = require('../common/tmpdir');
1215
tmpdir.refresh();
1316

test/parallel/test-fs-options-immutable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ if (common.canCreateSymLink()) {
4646
fs.appendFile(fileName, 'ABCD', options, common.mustCall(errHandler));
4747
}
4848

49-
{
49+
if (!common.isIBMi) { // IBMi does not suppport fs.watch()
5050
const watch = fs.watch(__filename, options, common.mustNotCall());
5151
watch.close();
5252
}

test/parallel/test-fs-utimes.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,9 @@ function runTests(iter) {
144144
const path = `${tmpdir.path}/test-utimes-precision`;
145145
fs.writeFileSync(path, '');
146146

147-
// Test Y2K38 for all platforms [except 'arm', 'OpenBSD' and 'SunOS']
148-
if (!process.arch.includes('arm') && !common.isOpenBSD && !common.isSunOS) {
147+
// Test Y2K38 for all platforms [except 'arm', 'OpenBSD', 'SunOS' and 'IBMi']
148+
if (!process.arch.includes('arm') &&
149+
!common.isOpenBSD && !common.isSunOS && !common.isIBMi) {
149150
const Y2K38_mtime = 2 ** 31;
150151
fs.utimesSync(path, Y2K38_mtime, Y2K38_mtime);
151152
const Y2K38_stats = fs.statSync(path);

test/parallel/test-fs-watch-close-when-destroyed.js

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// already destroyed will result in a noop instead of a crash.
55

66
const common = require('../common');
7+
8+
if (common.isIBMi)
9+
common.skip('IBMi does not support `fs.watch()`');
10+
711
const tmpdir = require('../common/tmpdir');
812
const fs = require('fs');
913
const path = require('path');

test/parallel/test-fs-watch-enoent.js

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// This verifies the error thrown by fs.watch.
55

66
const common = require('../common');
7+
8+
if (common.isIBMi)
9+
common.skip('IBMi does not support `fs.watch()`');
10+
711
const assert = require('assert');
812
const fs = require('fs');
913
const tmpdir = require('../common/tmpdir');

test/parallel/test-fs-watch.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
'use strict';
22
const common = require('../common');
33

4+
if (common.isIBMi)
5+
common.skip('IBMi does not support `fs.watch()`');
6+
47
// Tests if `filename` is provided to watcher on supported platforms
58

69
const fs = require('fs');

test/parallel/test-memory-usage-emfile.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
'use strict';
2-
require('../common');
2+
const common = require('../common');
3+
4+
// On IBMi, the rss memory always returns zero
5+
if (common.isIBMi)
6+
common.skip('On IBMi, the rss memory always returns zero');
7+
38
const assert = require('assert');
49

510
const fs = require('fs');

test/parallel/test-memory-usage.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

2222
'use strict';
23-
require('../common');
23+
const common = require('../common');
2424
const assert = require('assert');
2525

2626
const r = process.memoryUsage();
27-
assert.ok(r.rss > 0);
27+
// On IBMi, the rss memory always returns zero
28+
if (!common.isIBMi)
29+
assert.ok(r.rss > 0);
2830
assert.ok(r.heapTotal > 0);
2931
assert.ok(r.heapUsed > 0);
3032
assert.ok(r.external > 0);

test/parallel/test-module-loading-error.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ const errorMessagesByPlatform = {
3131
darwin: ['file too short'],
3232
aix: ['Cannot load module',
3333
'Cannot run a file that does not have a valid format.',
34-
'Exec format error']
34+
'Exec format error'],
35+
ibmi: ['Cannot load module',
36+
'The module has too many section headers',
37+
'or the file has been truncated.'],
3538
};
3639
// If we don't know a priori what the error would be, we accept anything.
37-
const errorMessages = errorMessagesByPlatform[process.platform] || [''];
40+
const platform = common.isIBMi ? 'ibmi' : process.platform;
41+
const errorMessages = errorMessagesByPlatform[platform] || [''];
3842

3943
// On Windows, error messages are MUI dependent
4044
// Ref: https://github.com/nodejs/node/issues/13376

test/parallel/test-net-pipe-connect-errors.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ noEntSocketClient.on('error', common.mustCall(function(err) {
7676
}));
7777

7878

79-
// On Windows or when running as root, a chmod has no effect on named pipes
80-
if (!common.isWindows && process.getuid() !== 0) {
79+
// On Windows or IBMi or when running as root,
80+
// a chmod has no effect on named pipes
81+
if (!common.isWindows && !common.isIBMi && process.getuid() !== 0) {
8182
// Trying to connect to a socket one has no access to should result in EACCES
8283
const accessServer = net.createServer(
8384
common.mustNotCall('server callback should not run'));

test/parallel/test-os-process-priority.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
'use strict';
22
const common = require('../common');
3+
// IBMi process priority is different.
4+
if (common.isIBMi)
5+
common.skip('IBMi has a different process priority');
6+
37
const assert = require('assert');
48
const os = require('os');
59
const {

test/parallel/test-os.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,12 @@ const hostname = os.hostname();
8585
is.string(hostname);
8686
assert.ok(hostname.length > 0);
8787

88-
const uptime = os.uptime();
89-
is.number(uptime);
90-
assert.ok(uptime > 0);
88+
// On IBMi, os.uptime() returns 'undefined'
89+
if (!common.isIBMi) {
90+
const uptime = os.uptime();
91+
is.number(uptime);
92+
assert.ok(uptime > 0);
93+
}
9194

9295
const cpus = os.cpus();
9396
is.array(cpus);
@@ -244,8 +247,11 @@ assert.strictEqual(`${os.platform}`, os.platform());
244247
assert.strictEqual(+os.totalmem, os.totalmem());
245248

246249
// Assert that the following values are coercible to numbers.
247-
is.number(+os.uptime, 'uptime');
248-
is.number(os.uptime(), 'uptime');
250+
// On IBMi, os.uptime() returns 'undefined'
251+
if (!common.isIBMi) {
252+
is.number(+os.uptime, 'uptime');
253+
is.number(os.uptime(), 'uptime');
254+
}
249255

250256
is.number(+os.freemem, 'freemem');
251257
is.number(os.freemem(), 'freemem');

test/parallel/test-process-euid-egid.js

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ assert.throws(() => {
2929
message: 'User identifier does not exist: fhqwhgadshgnsdhjsdbkhsdabkfabkveyb'
3030
});
3131

32+
// IBMi does not support below operations.
33+
if (common.isIBMi)
34+
return;
35+
3236
// If we're not running as super user...
3337
if (process.getuid() !== 0) {
3438
// Should not throw.

test/parallel/test-process-title-cli.js

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ const common = require('../common');
66
if (common.isSunOS)
77
common.skip(`Unsupported platform [${process.platform}]`);
88

9+
if (common.isIBMi)
10+
common.skip('Unsupported platform IBMi');
11+
912
const assert = require('assert');
1013

1114
// Verifies that the --title=foo command line flag set the process

test/parallel/test-setproctitle.js

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ const common = require('../common');
55
// FIXME add sunos support
66
if (common.isSunOS)
77
common.skip(`Unsupported platform [${process.platform}]`);
8+
// FIXME add IBMi support
9+
if (common.isIBMi)
10+
common.skip('Unsupported platform IBMi');
811
if (!common.isMainThread)
912
common.skip('Setting the process title from Workers is not supported');
1013

test/parallel/test-trace-events-metadata.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ proc.once('exit', common.mustCall(() => {
6464
(!process.release.lts ||
6565
trace.args.process.release.lts === process.release.lts)));
6666

67-
if (!common.isSunOS) {
67+
if (!common.isSunOS && !common.isIBMi) {
6868
// Changing process.title is currently unsupported on SunOS/SmartOS
69+
// and IBMi
6970
assert(traces.some((trace) =>
7071
trace.name === 'process_name' && trace.args.name === 'foo'));
7172
assert(traces.some((trace) =>

test/parallel/test-worker-memory.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
'use strict';
22
const common = require('../common');
3+
if (common.isIBMi)
4+
common.skip('On IBMi, the rss memory always returns zero');
5+
36
const assert = require('assert');
47
const util = require('util');
58
const { Worker } = require('worker_threads');

test/report/test-report-uv-handles.js

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
// Testcase to check reporting of uv handles.
44
const common = require('../common');
5+
if (common.isIBMi)
6+
common.skip('IBMi does not support fs.watch()');
7+
58
common.skipIfReportDisabled();
69
if (process.argv[2] === 'child') {
710
// Exit on loss of parent process

test/sequential/sequential.status

+6
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,10 @@ test-worker-prof: PASS, FLAKY
2424
# https://github.com/nodejs/node/pull/29054
2525
test-buffer-creation-regression: SKIP
2626

27+
[$system==ibmi]
28+
# https://github.com/nodejs/node/pull/29054
29+
test-buffer-creation-regression: SKIP
30+
# https://github.com/nodejs/node/pull/30819
31+
test-perf-hooks: SKIP
32+
2733
[$arch==arm]

test/sequential/test-fs-watch.js

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
'use strict';
2323
const common = require('../common');
24+
if (common.isIBMi)
25+
common.skip('IBMi does not support fs.watch()');
2426

2527
const assert = require('assert');
2628
const fs = require('fs');

test/sequential/test-inspector-contexts.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ async function testContextCreatedAndDestroyed() {
2525
session.post('Runtime.enable', assert.ifError);
2626
const contextCreated = await mainContextPromise;
2727
const { name, origin, auxData } = contextCreated.params.context;
28-
if (common.isSunOS || common.isWindows) {
29-
// uv_get_process_title() is unimplemented on Solaris-likes, it returns
30-
// an empty string. On the Windows CI buildbots it returns
28+
if (common.isSunOS || common.isWindows || common.isIBMi) {
29+
// uv_get_process_title() is unimplemented on Solaris-likes and IBMi,
30+
// it returns an empty string. On the Windows CI buildbots it returns
3131
// "Administrator: Windows PowerShell[42]" because of a GetConsoleTitle()
3232
// quirk. Not much we can do about either, just verify that it contains
3333
// the PID.

tools/utils.py

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ def GuessOS():
6969
return 'freebsd'
7070
elif id == 'AIX':
7171
return 'aix'
72+
elif id == 'OS400':
73+
return 'ibmi'
7274
else:
7375
return None
7476

0 commit comments

Comments
 (0)