Skip to content

Conversation

wingo
Copy link
Collaborator

@wingo wingo commented Sep 16, 2025

No description provided.

@wingo wingo force-pushed the filesystem-mkdir-rmdir branch 2 times, most recently from 995dfc0 to 836df64 Compare September 22, 2025 09:57
@wingo wingo changed the title wasi:[email protected]: Add tests for mkdir/rmdir wasi:[email protected]: Add tests for mkdir/rmdir Sep 22, 2025
@wingo wingo force-pushed the filesystem-mkdir-rmdir branch from 836df64 to 32d7e43 Compare September 22, 2025 11:44
@wingo wingo marked this pull request as ready for review September 22, 2025 14:31

async fn test_mkdir_rmdir(dir: &Descriptor) {
let mkdir = |path: &str| dir.create_directory_at(path.to_string());
let rmdir = |path: &str| dir.remove_directory_at(path.to_string());
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please add exploration of behavior further down the tree, where the test creates a dir and then opens it as a Descriptor and performs operations there, most interestingly the operations on .. and ../sibling?

@wingo wingo force-pushed the filesystem-mkdir-rmdir branch from 32d7e43 to 632b27a Compare October 7, 2025 07:36
@wingo wingo force-pushed the filesystem-mkdir-rmdir branch from 632b27a to e890570 Compare October 7, 2025 12:16
rmdir("parent/fs-tests.dir/q.cleanup").await,
Err(ErrorCode::NotPermitted)
);
assert_eq!(rmdir("q.cleanup/").await, Err(ErrorCode::Invalid));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Test filesystem-mkdir-rmdir failed
[exit_code] 0 == 3
STDOUT:

STDERR:

thread '' (1) panicked at src/bin/filesystem-mkdir-rmdir.rs:51:5:
assertion left == right failed
left: Err(ErrorCode { code: 0, name: "access", message: "Permission denied, similar to EACCES in POSIX." })
right: Err(ErrorCode { code: 11, name: "invalid", message: "Invalid argument, similar to EINVAL in POSIX." })
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Error: failed to run main module tests\rust\testsuite\wasm32-wasip3\filesystem-mkdir-rmdir.wasm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants