Skip to content

Commit 97c7c2a

Browse files
authored
Run test_chmod in nodefs. NFC (#23230)
Catches a bug in `lchmod` in NODEFS. The fix will be quite simple after #23058 is merged.
1 parent 714eaea commit 97c7c2a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

test/stat/test_chmod.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ void test() {
146146
lstat("file-link", &s);
147147
assert(s.st_mode == link_mode);
148148

149+
// TODO: lchmod is not supported in NODEFS but it chmods the link target
150+
// instead of raising an error. Will fix in a follow up to #23058.
151+
#ifndef NODEFS
149152
//
150153
// chmod the actual symlink
151154
//
@@ -157,6 +160,7 @@ void test() {
157160
// make sure the file it references didn't change
158161
stat("file-link", &s);
159162
assert(s.st_mode == (S_IRUSR | S_IFREG));
163+
#endif
160164
#endif // WASMFS
161165

162166
assert(stat("", &s) == -1);

test/test_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5529,7 +5529,7 @@ def test_stat_chmod(self):
55295529
nodefs = '-DNODEFS' in self.emcc_args or '-DNODERAWFS' in self.emcc_args
55305530
if nodefs and WINDOWS:
55315531
self.skipTest('mode bits work differently on windows')
5532-
if self.get_setting('WASMFS') and self.get_setting('NODERAWFS'):
5532+
if nodefs and self.get_setting('WASMFS'):
55335533
self.skipTest('test requires symlink creation which currently missing from wasmfs+noderawfs')
55345534
self.do_runf('stat/test_chmod.c', 'success')
55355535

0 commit comments

Comments
 (0)