Skip to content

Commit

Permalink
test: fix running child-process-uid-gid as root
Browse files Browse the repository at this point in the history
This skips the child-test-uid-gid test when run as root.
Previously, the test failed if executed as root.

PR-URL: #8864
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ilkka Myller <[email protected]>
  • Loading branch information
geek authored and Fishrock123 committed Oct 11, 2016
1 parent 77fc5ca commit 76f80a3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/parallel/test-child-process-uid-gid.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ const common = require('../common');
const assert = require('assert');
const spawn = require('child_process').spawn;

if (process.getuid() === 0) {
common.skip('as this test should not be run as `root`');
return;
}

const expectedError = common.isWindows ? /\bENOTSUP\b/ : /\bEPERM\b/;

assert.throws(() => {
Expand Down

0 comments on commit 76f80a3

Please sign in to comment.