diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-04-24 06:28:34 +0200 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-04-29 05:32:34 +0200 |
commit | 274364580a218f331b10e832d0face7a713bb8f0 (patch) | |
tree | b36644bdd6fd46fce070550d4acf60549d9b1f10 /test/parallel/test-fs-copyfile-respect-permissions.js | |
parent | d69f00465790f1ac7788ac111bb61689543536ae (diff) | |
download | android-node-v8-274364580a218f331b10e832d0face7a713bb8f0.tar.gz android-node-v8-274364580a218f331b10e832d0face7a713bb8f0.tar.bz2 android-node-v8-274364580a218f331b10e832d0face7a713bb8f0.zip |
test: skip fs-copyfile-respect-permission if root
Currently, if this test is run as the root user the following
failure will occur:
=== release test-fs-copyfile-respect-permissions ===
Path: parallel/test-fs-copyfile-respect-permissions
assert.js:89
throw new AssertionError(obj);
^
AssertionError [ERR_ASSERTION]: Missing expected exception (check).
at Object.<anonymous>
(/node/test/parallel/test-fs-copyfile-respect-permissions.js:38:10)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:826:10)
at internal/main/run_main_module.js:17:11
Command:
out/Release/node test/parallel/test-fs-copyfile-respect-permissions.js
[05:41|% 100|+ 2620|- 1]: Done
This commit adds a root user check and skips this test if running as the
user root.
PR-URL: https://github.com/nodejs/node/pull/27378
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Diffstat (limited to 'test/parallel/test-fs-copyfile-respect-permissions.js')
-rw-r--r-- | test/parallel/test-fs-copyfile-respect-permissions.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/parallel/test-fs-copyfile-respect-permissions.js b/test/parallel/test-fs-copyfile-respect-permissions.js index 2021e9ba63..ae7829fba3 100644 --- a/test/parallel/test-fs-copyfile-respect-permissions.js +++ b/test/parallel/test-fs-copyfile-respect-permissions.js @@ -5,6 +5,9 @@ const common = require('../common'); +if (!common.isWindows && process.getuid() === 0) + common.skip('as this test should not be run as `root`'); + const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); |