Welcome! Log In Create A New Profile

Advanced

[njs] Test262: handling the mkdir issue with a host file system.

Dmitry Volyntsev
January 29, 2024 08:18PM
details: https://hg.nginx.org/njs/rev/9e2a757cb33e
branches:
changeset: 2276:9e2a757cb33e
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Mon Jan 29 17:16:01 2024 -0800
description:
Test262: handling the mkdir issue with a host file system.

diffstat:

test/fs/promises_05.t.js | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r a2959e490279 -r 9e2a757cb33e test/fs/promises_05.t.js
--- a/test/fs/promises_05.t.js Mon Jan 29 08:57:49 2024 -0800
+++ b/test/fs/promises_05.t.js Mon Jan 29 17:16:01 2024 -0800
@@ -49,7 +49,18 @@ var testSync = () => new Promise((resolv
try {
fs.writeFileSync(fname(dname_utf8), fname(dname_utf8));

- throw new Error('fs.mkdirSync error 1');
+ const mode = fs.statSync(fname(dname_utf8)).mode & 0o777;
+
+ if (mode == 0o555) {
+ /*
+ * Some file systems ignore the mode parameter for mkdir.
+ * For example: a shared folder on a MacOS host mounted
+ * to a Linux guest via Parallels Desktop.
+ */
+ throw new Error('fs.writeFileSync did not respect mode');
+ }
+
+ fs.unlinkSync(fname(dname_utf8));

} catch (e) {
if (e.syscall != 'open' || e.code != 'EACCES') {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Test262: handling the mkdir issue with a host file system.

Dmitry Volyntsev 259 January 29, 2024 08:18PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 112
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready