Skip to content
Merged
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
11 changes: 6 additions & 5 deletions tests/rust/wasm32-wasip3/src/bin/filesystem-hard-links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ async fn test_hard_links(dir: &Descriptor) {
let rmdir = |path: &str| dir.remove_directory_at(path.to_string());

// link-at: async func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow<descriptor>, new-path: string) -> result<_, error-code>;
assert_eq!(ln(".", "foo").await, Err(ErrorCode::NotPermitted));
assert!(matches!(ln(".", "foo").await,
Err(ErrorCode::NotPermitted | ErrorCode::Access)));

assert_eq!(ln("", "foo").await, Err(ErrorCode::NoEntry));
assert_eq!(ln("", "").await, Err(ErrorCode::NoEntry));
assert_eq!(ln("a.txt", "").await, Err(ErrorCode::NoEntry));
Expand All @@ -39,7 +41,7 @@ async fn test_hard_links(dir: &Descriptor) {
assert_eq!(ln("a.txt", "/a.txt").await, Err(ErrorCode::NotPermitted));
assert_eq!(ln("..", "a.txt").await, Err(ErrorCode::NotPermitted));
assert_eq!(ln("a.txt", "..").await, Err(ErrorCode::NotPermitted));
// FIXME: https://github.com/WebAssembly/wasi-filesystem/issues/191
// FIXME: https://github.com/WebAssembly/WASI/issues/710
// assert_eq!(ln_follow("parent/foo", "a.txt").await,
// Err(ErrorCode::NotPermitted));
assert_eq!(ln("parent/foo", "a.txt").await,
Expand All @@ -51,9 +53,8 @@ async fn test_hard_links(dir: &Descriptor) {
mkdir("d.cleanup").await.unwrap();
ln("a.txt", "d.cleanup/q.txt").await.unwrap();
rm("d.cleanup/q.txt").await.unwrap();
// https://github.com/WebAssembly/wasi-filesystem/issues/184
assert_eq!(ln("d.cleanup", "e.cleanup").await,
Err(ErrorCode::NotPermitted));
assert!(matches!(ln("d.cleanup", "e.cleanup").await,
Err(ErrorCode::NotPermitted | ErrorCode::Access)));
rmdir("d.cleanup").await.unwrap();
}

Expand Down
Loading