aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaijiro Wachi <daijiro.wachi@gmail.com>2018-02-28 18:42:42 +0100
committerDaijiro Wachi <daijiro.wachi@gmail.com>2018-03-02 22:36:07 +0100
commitc05c73a634e3a88372e32e500f462851add7ea66 (patch)
tree62235ee4c6e8fd00fa6502e4b8f98ce7220ef82a /test
parent81d73fe83e280a36b094980eee85badece94f5ea (diff)
downloadandroid-node-v8-c05c73a634e3a88372e32e500f462851add7ea66.tar.gz
android-node-v8-c05c73a634e3a88372e32e500f462851add7ea66.tar.bz2
android-node-v8-c05c73a634e3a88372e32e500f462851add7ea66.zip
test: add test cases for fsPromises
Add tests of lchmod, chown, fchown and lchown. PR-URL: https://github.com/nodejs/node/pull/19064 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-fs-promises.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/parallel/test-fs-promises.js b/test/parallel/test-fs-promises.js
index e24374602b..63a1803c0a 100644
--- a/test/parallel/test-fs-promises.js
+++ b/test/parallel/test-fs-promises.js
@@ -9,8 +9,10 @@ const fsPromises = require('fs/promises');
const {
access,
chmod,
+ chown,
copyFile,
fchmod,
+ fchown,
fdatasync,
fstat,
fsync,
@@ -27,6 +29,8 @@ const {
realpath,
rename,
rmdir,
+ lchmod,
+ lchown,
stat,
symlink,
write,
@@ -95,6 +99,21 @@ function verifyStatObject(stat) {
await chmod(dest, 0o666);
await fchmod(handle, 0o666);
+ // lchmod is only available on OSX
+ if (common.isOSX) {
+ await lchmod(dest, 0o666);
+ }
+
+ if (!common.isWindows) {
+ const gid = process.getgid();
+ const uid = process.getuid();
+ await chown(dest, uid, gid);
+ await fchown(handle, uid, gid);
+ // lchown is only available on OSX
+ if (common.isOSX) {
+ await lchown(dest, uid, gid);
+ }
+ }
await utimes(dest, new Date(), new Date());