Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
test: add support for NODE_TEST_DIR on a separate mount point
Linux permits a filesystem to be mounted at multiple points, but
`fs.renameSync` does not work across different mount points, even if the
same filesystem is mounted on both.
This fixes failing tests when NODE_TEST_DIR mount point is different
from the one on which the tests are executed (E.G. on a separate
partition).

Ref: http://man7.org/linux/man-pages/man2/rename.2.html
  • Loading branch information
aduh95 committed Jun 26, 2018
commit cf8a1eceafece8866754a47486054d4066426ba2
2 changes: 1 addition & 1 deletion test/parallel/test-fs-copyfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ try {
} catch (err) {
assert.strictEqual(err.syscall, 'copyfile');
assert(err.code === 'ENOTSUP' || err.code === 'ENOTTY' ||
err.code === 'ENOSYS');
err.code === 'ENOSYS' || err.code === 'EXDEV');
assert.strictEqual(err.path, src);
assert.strictEqual(err.dest, dest);
}
Expand Down
5 changes: 5 additions & 0 deletions test/parallel/test-fs-error-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ function re(literals, ...values) {
`ENOTEMPTY: directory not empty, rename '${existingDir}' -> ` +
`'${existingDir2}'`);
assert.strictEqual(err.errno, uv.UV_ENOTEMPTY);
} else if (err.code === 'EXDEV') { // not on the same mounted filesystem
assert.strictEqual(
err.message,
`EXDEV: cross-device link not permitted, rename '${existingDir}' -> ` +
`'${existingDir2}'`);
} else if (err.code === 'EEXIST') { // smartos and aix
assert.strictEqual(
err.message,
Expand Down