diff options
author | Wyatt Preul <wpreul@gmail.com> | 2016-09-30 12:34:30 -0500 |
---|---|---|
committer | Wyatt Preul <wpreul@gmail.com> | 2016-10-03 09:21:53 -0500 |
commit | 8dc2b422a915f7b9741b7b7d37c3bcc2e3458f54 (patch) | |
tree | d90bbbddf13d5f11a7e5085de3e18048b8ededed /test | |
parent | 15bd66be1aa7403a9b7d9b1be43fabdf0f5f69fd (diff) | |
download | android-node-v8-8dc2b422a915f7b9741b7b7d37c3bcc2e3458f54.tar.gz android-node-v8-8dc2b422a915f7b9741b7b7d37c3bcc2e3458f54.tar.bz2 android-node-v8-8dc2b422a915f7b9741b7b7d37c3bcc2e3458f54.zip |
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: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-child-process-uid-gid.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/parallel/test-child-process-uid-gid.js b/test/parallel/test-child-process-uid-gid.js index 220cae633e..1ab514566c 100644 --- a/test/parallel/test-child-process-uid-gid.js +++ b/test/parallel/test-child-process-uid-gid.js @@ -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(() => { |