Skip to content

Commit 8724c44

Browse files
TrottMyles Borins
authored and
Myles Borins
committed
test: add test for uid/gid setting in spawn
Remove a disabled test in favor of one that expects an error. This validates (somewhat) that the underlying code is calling the correct system call for setting UID and GID. Unlike the formerly disabled test, it does not try to validate that the system UID/GID setting works. PR-URL: #7084 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 042e858 commit 8724c44

File tree

2 files changed

+14
-60
lines changed

2 files changed

+14
-60
lines changed

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

-60
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const spawn = require('child_process').spawn;
5+
6+
const expectedError = common.isWindows ? /\bENOTSUP\b/ : /\bEPERM\b/;
7+
8+
assert.throws(() => {
9+
spawn('echo', ['fhqwhgads'], {uid: 0});
10+
}, expectedError);
11+
12+
assert.throws(() => {
13+
spawn('echo', ['fhqwhgads'], {gid: 0});
14+
}, expectedError);

0 commit comments

Comments
 (0)