Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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.
  • Loading branch information
danbev committed Apr 24, 2019
commit d433c3132847334c0e3b42afa2beb9f57d20307e
3 changes: 3 additions & 0 deletions test/parallel/test-fs-copyfile-respect-permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

const common = require('../common');

if (process.getuid() === 0)
Comment thread
danbev marked this conversation as resolved.
Outdated
common.skip('as this test should not be run as `root`');

const tmpdir = require('../common/tmpdir');
tmpdir.refresh();

Expand Down