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 <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>
  • Loading branch information
geek authored and jasnell committed Oct 6, 2016
1 parent 570c8e7 commit 2f1a4cb
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 2f1a4cb

Please sign in to comment.