diff --git a/crates/test-programs/TEST_FAILURES b/crates/test-programs/TEST_FAILURES index a2c42a4491..704f853d6f 100644 --- a/crates/test-programs/TEST_FAILURES +++ b/crates/test-programs/TEST_FAILURES @@ -33,8 +33,10 @@ TODOs: - on windows, opening `dir/nested/file/` (line 53) with a trailing slash gets you a NOENT instead of a NOTDIR errno. * nofollow_errors - - panic in my io::Error translation code: Unhandled kind: Other, caused by - "symlink encountered" + - I loosened up some errno acceptance but still cant delete a symlink to a + directory +* symlink_create + - narrowed down the symlink delete issue that only shows up on linux * path_rename - permission denied on windows to rename a dir to an existing empty dir diff --git a/crates/test-programs/build.rs b/crates/test-programs/build.rs index ce38998700..f8f1f79c58 100644 --- a/crates/test-programs/build.rs +++ b/crates/test-programs/build.rs @@ -173,6 +173,8 @@ mod wasi_tests { /// Ignore tests that aren't supported yet. fn ignore(testsuite: &str, name: &str) -> bool { if testsuite == "wasi-tests" { + false + /* match name { "readlink_no_buffer" => true, "dangling_symlink" => true, @@ -181,6 +183,7 @@ mod wasi_tests { "dangling_fd" => true, _ => false, } + */ } else { unreachable!() } diff --git a/crates/test-programs/wasi-tests/src/bin/nofollow_errors.rs b/crates/test-programs/wasi-tests/src/bin/nofollow_errors.rs index 7b14c4692c..a81944862c 100644 --- a/crates/test-programs/wasi-tests/src/bin/nofollow_errors.rs +++ b/crates/test-programs/wasi-tests/src/bin/nofollow_errors.rs @@ -16,16 +16,18 @@ unsafe fn test_nofollow_errors(dir_fd: wasi::Fd) { .raw_error(); assert!( dir_open_errno == wasi::ERRNO_LOOP || dir_open_errno == wasi::ERRNO_NOTDIR, - "errno should be ERRNO_LOOP or ERRNO_NOTDIR", + "errno should be ERRNO_LOOP or ERRNO_NOTDIR, got {}", + dir_open_errno, ); // Try to open it with just O_NOFOLLOW. - assert_eq!( - wasi::path_open(dir_fd, 0, "symlink", 0, 0, 0, 0) - .expect_err("opening a symlink with O_NOFOLLOW should fail") - .raw_error(), - wasi::ERRNO_LOOP, - "errno should be ERRNO_LOOP", + let file_open_errno = wasi::path_open(dir_fd, 0, "symlink", 0, 0, 0, 0) + .expect_err("opening a symlink with O_NOFOLLOW should fail") + .raw_error(); + assert!( + file_open_errno == wasi::ERRNO_LOOP || file_open_errno == wasi::ERRNO_ACCES, + "errno should be ERRNO_LOOP or ERRNO_ACCES, got {}", + file_open_errno, ); // Try to open it as a directory without O_NOFOLLOW. diff --git a/crates/test-programs/wasi-tests/src/bin/symlink_create.rs b/crates/test-programs/wasi-tests/src/bin/symlink_create.rs index 17e55337b1..bf854486ee 100644 --- a/crates/test-programs/wasi-tests/src/bin/symlink_create.rs +++ b/crates/test-programs/wasi-tests/src/bin/symlink_create.rs @@ -61,7 +61,9 @@ unsafe fn create_symlink_to_directory(dir_fd: wasi::Fd) { wasi::fd_close(target_dir_via_symlink).expect("closing a file"); // Replace the target directory with a file. - wasi::path_unlink_file(dir_fd, "symlink").expect("removing a file"); + wasi::path_unlink_file(dir_fd, "symlink").expect("remove symlink to directory"); + // FIXME: use the line below instead of the line above, and this test passes on windows! + //wasi::path_remove_directory(dir_fd, "symlink").expect("remove symlink to directory"); wasi::path_remove_directory(dir_fd, "target") .expect("remove_directory on a directory should succeed"); }