Skip to content

Commit e34e859

Browse files
committed
test: fix running child-process-uid-gid as root
This skips the child-test-uid-gid test when run as root. Previously, the test failed if executed as root. PR-URL: nodejs#8864 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
1 parent 68c4c71 commit e34e859

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ const common = require('../common');
33
const assert = require('assert');
44
const spawn = require('child_process').spawn;
55

6+
if (process.getuid() === 0) {
7+
common.skip('as this test should not be run as `root`');
8+
return;
9+
}
10+
611
const expectedError = common.isWindows ? /\bENOTSUP\b/ : /\bEPERM\b/;
712

813
assert.throws(() => {

0 commit comments

Comments
 (0)