Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run test_chmod in nodefs. NFC #23230

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions test/stat/test_chmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ void test() {
lstat("file-link", &s);
assert(s.st_mode == link_mode);

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

puts("success");
Expand Down
8 changes: 4 additions & 4 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5523,12 +5523,12 @@ def test_fstatat(self):
self.do_runf('stat/test_fstatat.c', 'success')

@crossplatform
@also_with_wasmfs
@also_with_noderawfs
@with_all_fs
def test_stat_chmod(self):
if self.get_setting('NODERAWFS') and WINDOWS:
nodefs = '-DNODEFS' in self.emcc_args or '-DNODERAWFS' in self.emcc_args
if nodefs and WINDOWS:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we use to run this test with -DNODEFS on windows, but not after this change?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops, sorry I just saw that this change includes a change to the test (which presumably makes it no longer compatible with windows+nodefs). lgtm.

self.skipTest('mode bits work differently on windows')
if self.get_setting('WASMFS') and self.get_setting('NODERAWFS'):
if nodefs and self.get_setting('WASMFS'):
self.skipTest('test requires symlink creation which currently missing from wasmfs+noderawfs')
self.do_runf('stat/test_chmod.c', 'success')

Expand Down
Loading