diff --git a/host/tests/command.rs b/host/tests/command.rs index 67c8c0bc0952..17d724f573d4 100644 --- a/host/tests/command.rs +++ b/host/tests/command.rs @@ -306,8 +306,6 @@ async fn run_default_clocks(mut store: Store, wasi: Command) -> Result< async fn run_with_temp_dir(mut store: Store, wasi: Command) -> Result<()> { let dir = tempfile::tempdir()?; - store.data_mut().push_env("NO_RIGHTS_READBACK_SUPPORT", "1"); - if cfg!(windows) { store.data_mut().push_env("ERRNO_MODE_WINDOWS", "1"); store.data_mut().push_env("NO_FDFLAGS_SYNC_SUPPORT", "1"); @@ -442,12 +440,6 @@ async fn run_path_open_missing(store: Store, wasi: Command) -> Result<( run_with_temp_dir(store, wasi).await } -async fn run_path_open_read_without_rights(store: Store, wasi: Command) -> Result<()> { - // unreachable in adapter line 557, inside fd_fdstat_set_rights, when test program is trying to - // drop the RIGHTS_FD_READ right - expect_fail(run_with_temp_dir(store, wasi).await) -} - async fn run_path_rename(store: Store, wasi: Command) -> Result<()> { run_with_temp_dir(store, wasi).await } diff --git a/test-programs/wasi-tests/src/bin/directory_seek.rs b/test-programs/wasi-tests/src/bin/directory_seek.rs index 5ee6ff457dbe..dc4fd52fb52f 100644 --- a/test-programs/wasi-tests/src/bin/directory_seek.rs +++ b/test-programs/wasi-tests/src/bin/directory_seek.rs @@ -1,21 +1,13 @@ use std::{env, process}; -use wasi_tests::{assert_errno, open_scratch_directory, TESTCONFIG}; +use wasi_tests::{assert_errno, open_scratch_directory}; unsafe fn test_directory_seek(dir_fd: wasi::Fd) { // Create a directory in the scratch directory. wasi::path_create_directory(dir_fd, "dir").expect("failed to make directory"); // Open the directory and attempt to request rights for seeking. - let fd = wasi::path_open( - dir_fd, - 0, - "dir", - wasi::OFLAGS_DIRECTORY, - wasi::RIGHTS_FD_SEEK, - 0, - 0, - ) - .expect("failed to open file"); + let fd = wasi::path_open(dir_fd, 0, "dir", wasi::OFLAGS_DIRECTORY, 0, 0, 0) + .expect("failed to open file"); assert!( fd > libc::STDERR_FILENO as wasi::Fd, "file descriptor range check", @@ -27,21 +19,6 @@ unsafe fn test_directory_seek(dir_fd: wasi::Fd) { wasi::ERRNO_BADF ); - // Check if we obtained the right to seek. - let fdstat = wasi::fd_fdstat_get(fd).expect("failed to fdstat"); - assert_eq!( - fdstat.fs_filetype, - wasi::FILETYPE_DIRECTORY, - "expected the scratch directory to be a directory", - ); - if TESTCONFIG.support_rights_readback() { - assert_eq!( - (fdstat.fs_rights_base & wasi::RIGHTS_FD_SEEK), - 0, - "directory does NOT have the seek right", - ); - } - // Clean up. wasi::fd_close(fd).expect("failed to close fd"); wasi::path_remove_directory(dir_fd, "dir").expect("failed to remove dir"); diff --git a/test-programs/wasi-tests/src/bin/fd_advise.rs b/test-programs/wasi-tests/src/bin/fd_advise.rs index d6c37ae776fd..78a048db0f9e 100644 --- a/test-programs/wasi-tests/src/bin/fd_advise.rs +++ b/test-programs/wasi-tests/src/bin/fd_advise.rs @@ -8,12 +8,7 @@ unsafe fn test_fd_advise(dir_fd: wasi::Fd) { 0, "file", wasi::OFLAGS_CREAT, - wasi::RIGHTS_FD_READ - | wasi::RIGHTS_FD_WRITE - | wasi::RIGHTS_FD_ADVISE - | wasi::RIGHTS_FD_FILESTAT_GET - | wasi::RIGHTS_FD_FILESTAT_SET_SIZE - | wasi::RIGHTS_FD_ALLOCATE, + wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE, 0, 0, ) diff --git a/test-programs/wasi-tests/src/bin/fd_filestat_set.rs b/test-programs/wasi-tests/src/bin/fd_filestat_set.rs index 424831b33c86..de358dfff23e 100644 --- a/test-programs/wasi-tests/src/bin/fd_filestat_set.rs +++ b/test-programs/wasi-tests/src/bin/fd_filestat_set.rs @@ -8,11 +8,7 @@ unsafe fn test_fd_filestat_set(dir_fd: wasi::Fd) { 0, "file", wasi::OFLAGS_CREAT, - wasi::RIGHTS_FD_READ - | wasi::RIGHTS_FD_WRITE - | wasi::RIGHTS_FD_FILESTAT_GET - | wasi::RIGHTS_FD_FILESTAT_SET_SIZE - | wasi::RIGHTS_FD_FILESTAT_SET_TIMES, + wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE, 0, 0, ) diff --git a/test-programs/wasi-tests/src/bin/fd_flags_set.rs b/test-programs/wasi-tests/src/bin/fd_flags_set.rs index cd55c3da2880..85864547e527 100644 --- a/test-programs/wasi-tests/src/bin/fd_flags_set.rs +++ b/test-programs/wasi-tests/src/bin/fd_flags_set.rs @@ -10,11 +10,7 @@ unsafe fn test_fd_fdstat_set_flags(dir_fd: wasi::Fd) { 0, FILE_NAME, wasi::OFLAGS_CREAT, - wasi::RIGHTS_FD_READ - | wasi::RIGHTS_FD_WRITE - | wasi::RIGHTS_FD_SEEK - | wasi::RIGHTS_FD_TELL - | wasi::RIGHTS_FD_FDSTAT_SET_FLAGS, + wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE, 0, wasi::FDFLAGS_APPEND, ) diff --git a/test-programs/wasi-tests/src/bin/fd_readdir.rs b/test-programs/wasi-tests/src/bin/fd_readdir.rs index 87aa112c2b04..f7c5388f9cd9 100644 --- a/test-programs/wasi-tests/src/bin/fd_readdir.rs +++ b/test-programs/wasi-tests/src/bin/fd_readdir.rs @@ -98,10 +98,7 @@ unsafe fn test_fd_readdir(dir_fd: wasi::Fd) { 0, "file", wasi::OFLAGS_CREAT, - wasi::RIGHTS_FD_READ - | wasi::RIGHTS_FD_WRITE - | wasi::RIGHTS_FD_READDIR - | wasi::RIGHTS_FD_FILESTAT_GET, + wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE, 0, 0, ) @@ -155,10 +152,7 @@ unsafe fn test_fd_readdir_lots(dir_fd: wasi::Fd) { 0, &format!("file.{}", count), wasi::OFLAGS_CREAT, - wasi::RIGHTS_FD_READ - | wasi::RIGHTS_FD_WRITE - | wasi::RIGHTS_FD_READDIR - | wasi::RIGHTS_FD_FILESTAT_GET, + wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE, 0, 0, ) diff --git a/test-programs/wasi-tests/src/bin/file_allocate.rs b/test-programs/wasi-tests/src/bin/file_allocate.rs index 9008002e80bc..d7a6dd576257 100644 --- a/test-programs/wasi-tests/src/bin/file_allocate.rs +++ b/test-programs/wasi-tests/src/bin/file_allocate.rs @@ -8,10 +8,7 @@ unsafe fn test_file_allocate(dir_fd: wasi::Fd) { 0, "file", wasi::OFLAGS_CREAT, - wasi::RIGHTS_FD_READ - | wasi::RIGHTS_FD_WRITE - | wasi::RIGHTS_FD_ALLOCATE - | wasi::RIGHTS_FD_FILESTAT_GET, + wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE, 0, 0, ) diff --git a/test-programs/wasi-tests/src/bin/file_pread_pwrite.rs b/test-programs/wasi-tests/src/bin/file_pread_pwrite.rs index 9df32f3c32f1..918fec842bf1 100644 --- a/test-programs/wasi-tests/src/bin/file_pread_pwrite.rs +++ b/test-programs/wasi-tests/src/bin/file_pread_pwrite.rs @@ -9,7 +9,7 @@ unsafe fn test_file_pread_pwrite(dir_fd: wasi::Fd) { 0, "file", wasi::OFLAGS_CREAT, - wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_SEEK | wasi::RIGHTS_FD_WRITE, + wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE, 0, 0, ) diff --git a/test-programs/wasi-tests/src/bin/file_seek_tell.rs b/test-programs/wasi-tests/src/bin/file_seek_tell.rs index a3d3711b95e2..a54fe14ab05c 100644 --- a/test-programs/wasi-tests/src/bin/file_seek_tell.rs +++ b/test-programs/wasi-tests/src/bin/file_seek_tell.rs @@ -8,7 +8,7 @@ unsafe fn test_file_seek_tell(dir_fd: wasi::Fd) { 0, "file", wasi::OFLAGS_CREAT, - wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE | wasi::RIGHTS_FD_SEEK | wasi::RIGHTS_FD_TELL, + wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE, 0, 0, ) diff --git a/test-programs/wasi-tests/src/bin/path_filestat.rs b/test-programs/wasi-tests/src/bin/path_filestat.rs index 5da796b1b4c5..2c4b63a93e8c 100644 --- a/test-programs/wasi-tests/src/bin/path_filestat.rs +++ b/test-programs/wasi-tests/src/bin/path_filestat.rs @@ -2,13 +2,6 @@ use std::{env, process}; use wasi_tests::{assert_errno, open_scratch_directory, TESTCONFIG}; unsafe fn test_path_filestat(dir_fd: wasi::Fd) { - let mut fdstat = wasi::fd_fdstat_get(dir_fd).expect("fd_fdstat_get"); - assert_ne!( - fdstat.fs_rights_base & wasi::RIGHTS_PATH_FILESTAT_GET, - 0, - "the scratch directory should have RIGHT_PATH_FILESTAT_GET as base right", - ); - let fdflags = if TESTCONFIG.support_fdflags_sync() { wasi::FDFLAGS_APPEND | wasi::FDFLAGS_SYNC } else { @@ -21,7 +14,7 @@ unsafe fn test_path_filestat(dir_fd: wasi::Fd) { 0, "file", wasi::OFLAGS_CREAT, - wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE | wasi::RIGHTS_PATH_FILESTAT_GET, + wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE, 0, // Pass some flags for later retrieval fdflags, @@ -32,20 +25,7 @@ unsafe fn test_path_filestat(dir_fd: wasi::Fd) { "file descriptor range check", ); - fdstat = wasi::fd_fdstat_get(file_fd).expect("fd_fdstat_get"); - - if TESTCONFIG.support_rights_readback() { - assert_eq!( - fdstat.fs_rights_base & wasi::RIGHTS_PATH_FILESTAT_GET, - 0, - "files shouldn't have rights for path_* syscalls even if manually given", - ); - assert_eq!( - fdstat.fs_rights_inheriting & wasi::RIGHTS_PATH_FILESTAT_GET, - 0, - "files shouldn't have rights for path_* syscalls even if manually given", - ); - } + let fdstat = wasi::fd_fdstat_get(file_fd).expect("fd_fdstat_get"); assert_eq!( fdstat.fs_flags & wasi::FDFLAGS_APPEND, wasi::FDFLAGS_APPEND, @@ -66,7 +46,7 @@ unsafe fn test_path_filestat(dir_fd: wasi::Fd) { 0, "file", 0, - wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE | wasi::RIGHTS_PATH_FILESTAT_GET, + wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE, 0, wasi::FDFLAGS_SYNC, ) diff --git a/test-programs/wasi-tests/src/bin/path_link.rs b/test-programs/wasi-tests/src/bin/path_link.rs index 98443b9695b5..161d865df568 100644 --- a/test-programs/wasi-tests/src/bin/path_link.rs +++ b/test-programs/wasi-tests/src/bin/path_link.rs @@ -1,15 +1,8 @@ use std::{env, process}; use wasi_tests::{assert_errno, create_file, open_scratch_directory, TESTCONFIG}; -const TEST_RIGHTS: wasi::Rights = wasi::RIGHTS_FD_READ - | wasi::RIGHTS_PATH_LINK_SOURCE - | wasi::RIGHTS_PATH_LINK_TARGET - | wasi::RIGHTS_FD_FILESTAT_GET - | wasi::RIGHTS_PATH_OPEN - | wasi::RIGHTS_PATH_UNLINK_FILE; - unsafe fn create_or_open(dir_fd: wasi::Fd, name: &str, flags: wasi::Oflags) -> wasi::Fd { - let file_fd = wasi::path_open(dir_fd, 0, name, flags, TEST_RIGHTS, TEST_RIGHTS, 0) + let file_fd = wasi::path_open(dir_fd, 0, name, flags, 0, 0, 0) .unwrap_or_else(|_| panic!("opening '{}'", name)); assert!( file_fd > libc::STDERR_FILENO as wasi::Fd, @@ -19,7 +12,7 @@ unsafe fn create_or_open(dir_fd: wasi::Fd, name: &str, flags: wasi::Oflags) -> w } unsafe fn open_link(dir_fd: wasi::Fd, name: &str) -> wasi::Fd { - let file_fd = wasi::path_open(dir_fd, 0, name, 0, TEST_RIGHTS, TEST_RIGHTS, 0) + let file_fd = wasi::path_open(dir_fd, 0, name, 0, 0, 0, 0) .unwrap_or_else(|_| panic!("opening a link '{}'", name)); assert!( file_fd > libc::STDERR_FILENO as wasi::Fd, @@ -49,16 +42,14 @@ fn fdstats_assert_eq(left: wasi::Fdstat, right: wasi::Fdstat) { left.fs_filetype, right.fs_filetype, "fs_filetype should be equal" ); - if TESTCONFIG.support_rights_readback() { - assert_eq!( - left.fs_rights_base, right.fs_rights_base, - "fs_rights_base should be equal" - ); - assert_eq!( - left.fs_rights_inheriting, right.fs_rights_inheriting, - "fs_rights_inheriting should be equal" - ); - } + assert_eq!( + left.fs_rights_base, right.fs_rights_base, + "fs_rights_base should be equal" + ); + assert_eq!( + left.fs_rights_inheriting, right.fs_rights_inheriting, + "fs_rights_inheriting should be equal" + ); } unsafe fn check_rights(orig_fd: wasi::Fd, link_fd: wasi::Fd) { @@ -93,9 +84,9 @@ unsafe fn test_path_link(dir_fd: wasi::Fd) { wasi::path_link(dir_fd, 0, "file", subdir_fd, "link").expect("creating a link in subdirectory"); let link_fd = open_link(subdir_fd, "link"); check_rights(file_fd, link_fd); + wasi::fd_close(link_fd).expect("Closing link_fd"); // needed for Windows wasi::path_unlink_file(subdir_fd, "link").expect("removing a link"); wasi::fd_close(subdir_fd).expect("Closing subdir_fd"); // needed for Windows - wasi::fd_close(link_fd).expect("Closing link_fd"); // needed for Windows wasi::path_remove_directory(dir_fd, "subdir").expect("removing a subdirectory"); // Create a link to a path that already exists diff --git a/test-programs/wasi-tests/src/bin/path_open_read_without_rights.rs b/test-programs/wasi-tests/src/bin/path_open_read_without_rights.rs deleted file mode 100644 index ba83714b1184..000000000000 --- a/test-programs/wasi-tests/src/bin/path_open_read_without_rights.rs +++ /dev/null @@ -1,79 +0,0 @@ -use std::{env, process}; -use wasi_tests::{ - assert_errno, create_file, drop_rights, fd_get_rights, open_scratch_directory, TESTCONFIG, -}; - -const TEST_FILENAME: &'static str = "file"; - -unsafe fn try_read_file(dir_fd: wasi::Fd) { - let fd = wasi::path_open(dir_fd, 0, TEST_FILENAME, 0, 0, 0, 0).expect("opening the file"); - - if TESTCONFIG.support_rights_readback() { - // Check that we don't have the right to exeucute fd_read - let (rbase, rinher) = fd_get_rights(fd); - assert_eq!( - rbase & wasi::RIGHTS_FD_READ, - 0, - "should not have base RIGHTS_FD_READ" - ); - assert_eq!( - rinher & wasi::RIGHTS_FD_READ, - 0, - "should not have inheriting RIGHTS_FD_READ" - ); - } - - let contents = &mut [0u8; 1]; - let iovec = wasi::Iovec { - buf: contents.as_mut_ptr() as *mut _, - buf_len: contents.len(), - }; - // Since we no longer have the right to fd_read, trying to read a file - // should be an error. - assert_errno!( - wasi::fd_read(fd, &[iovec]).expect_err("reading bytes from file should fail"), - wasi::ERRNO_BADF - ); -} - -unsafe fn test_read_rights(dir_fd: wasi::Fd) { - create_file(dir_fd, TEST_FILENAME); - drop_rights(dir_fd, wasi::RIGHTS_FD_READ, wasi::RIGHTS_FD_READ); - - let (rbase, rinher) = fd_get_rights(dir_fd); - assert_eq!( - rbase & wasi::RIGHTS_FD_READ, - 0, - "dir should not have base RIGHTS_FD_READ" - ); - assert_eq!( - rinher & wasi::RIGHTS_FD_READ, - 0, - "dir should not have inheriting RIGHTS_FD_READ" - ); - - try_read_file(dir_fd); -} - -fn main() { - let mut args = env::args(); - let prog = args.next().unwrap(); - let arg = if let Some(arg) = args.next() { - arg - } else { - eprintln!("usage: {} ", prog); - process::exit(1); - }; - - // Open scratch directory - let dir_fd = match open_scratch_directory(&arg) { - Ok(dir_fd) => dir_fd, - Err(err) => { - eprintln!("{}", err); - process::exit(1) - } - }; - - // Run the tests. - unsafe { test_read_rights(dir_fd) } -} diff --git a/test-programs/wasi-tests/src/bin/poll_oneoff_files.rs b/test-programs/wasi-tests/src/bin/poll_oneoff_files.rs index cbf9803130cf..03539ea35de5 100644 --- a/test-programs/wasi-tests/src/bin/poll_oneoff_files.rs +++ b/test-programs/wasi-tests/src/bin/poll_oneoff_files.rs @@ -197,16 +197,8 @@ unsafe fn test_fd_readwrite_valid_fd(dir_fd: wasi::Fd) { wasi::fd_close(nonempty_file).expect("close"); // Now open the file for reading - let readable_fd = wasi::path_open( - dir_fd, - 0, - "readable_file", - 0, - wasi::RIGHTS_FD_READ | wasi::RIGHTS_POLL_FD_READWRITE, - 0, - 0, - ) - .expect("opening a readable file"); + let readable_fd = wasi::path_open(dir_fd, 0, "readable_file", 0, wasi::RIGHTS_FD_READ, 0, 0) + .expect("opening a readable file"); assert!( readable_fd > libc::STDERR_FILENO as wasi::Fd, @@ -218,7 +210,7 @@ unsafe fn test_fd_readwrite_valid_fd(dir_fd: wasi::Fd) { 0, "writable_file", wasi::OFLAGS_CREAT, - wasi::RIGHTS_FD_WRITE | wasi::RIGHTS_POLL_FD_READWRITE, + wasi::RIGHTS_FD_WRITE, 0, 0, ) @@ -231,6 +223,7 @@ unsafe fn test_fd_readwrite_valid_fd(dir_fd: wasi::Fd) { test_fd_readwrite(readable_fd, writable_fd, wasi::ERRNO_SUCCESS); wasi::fd_close(readable_fd).expect("closing readable_file"); + wasi::fd_close(writable_fd).expect("closing writable_file"); wasi::path_unlink_file(dir_fd, "readable_file").expect("removing readable_file"); wasi::path_unlink_file(dir_fd, "writable_file").expect("removing writable_file"); } diff --git a/test-programs/wasi-tests/src/bin/readlink.rs b/test-programs/wasi-tests/src/bin/readlink.rs index f085ef26b4c4..615647247a2a 100644 --- a/test-programs/wasi-tests/src/bin/readlink.rs +++ b/test-programs/wasi-tests/src/bin/readlink.rs @@ -1,5 +1,5 @@ use std::{env, process}; -use wasi_tests::{create_file, open_scratch_directory}; +use wasi_tests::{assert_errno, create_file, open_scratch_directory}; unsafe fn test_readlink(dir_fd: wasi::Fd) { // Create a file in the scratch directory. @@ -21,8 +21,6 @@ unsafe fn test_readlink(dir_fd: wasi::Fd) { ); // Read link into smaller buffer than the actual link's length - // FIXME: the adapter will actually truncate in this case. we could instead - // return an error in the adapter? let buf = &mut [0u8; 4]; let bufused = wasi::path_readlink(dir_fd, "symlink", buf.as_mut_ptr(), buf.len()) .expect("readlink with too-small buffer should silently truncate"); diff --git a/test-programs/wasi-tests/src/bin/renumber.rs b/test-programs/wasi-tests/src/bin/renumber.rs index 1ca5caefb2b1..1a50f02ade12 100644 --- a/test-programs/wasi-tests/src/bin/renumber.rs +++ b/test-programs/wasi-tests/src/bin/renumber.rs @@ -1,5 +1,5 @@ use std::{env, process}; -use wasi_tests::{assert_errno, open_scratch_directory, TESTCONFIG}; +use wasi_tests::{assert_errno, open_scratch_directory}; unsafe fn test_renumber(dir_fd: wasi::Fd) { let pre_fd: wasi::Fd = (libc::STDERR_FILENO + 1) as wasi::Fd; @@ -62,16 +62,14 @@ unsafe fn test_renumber(dir_fd: wasi::Fd) { fdstat_from.fs_flags, fdstat_to.fs_flags, "expected fd_to have the same fdstat as fd_from" ); - if TESTCONFIG.support_rights_readback() { - assert_eq!( - fdstat_from.fs_rights_base, fdstat_to.fs_rights_base, - "expected fd_to have the same fdstat as fd_from" - ); - assert_eq!( - fdstat_from.fs_rights_inheriting, fdstat_to.fs_rights_inheriting, - "expected fd_to have the same fdstat as fd_from" - ); - } + assert_eq!( + fdstat_from.fs_rights_base, fdstat_to.fs_rights_base, + "expected fd_to have the same fdstat as fd_from" + ); + assert_eq!( + fdstat_from.fs_rights_inheriting, fdstat_to.fs_rights_inheriting, + "expected fd_to have the same fdstat as fd_from" + ); wasi::fd_close(fd_to).expect("closing a file"); } diff --git a/test-programs/wasi-tests/src/bin/symlink_filestat.rs b/test-programs/wasi-tests/src/bin/symlink_filestat.rs index 950def6a7cec..cad9dcd6c034 100644 --- a/test-programs/wasi-tests/src/bin/symlink_filestat.rs +++ b/test-programs/wasi-tests/src/bin/symlink_filestat.rs @@ -1,23 +1,14 @@ use std::{env, process}; -use wasi_tests::{open_scratch_directory, TESTCONFIG}; +use wasi_tests::open_scratch_directory; unsafe fn test_path_filestat(dir_fd: wasi::Fd) { - if TESTCONFIG.support_rights_readback() { - let fdstat = wasi::fd_fdstat_get(dir_fd).expect("fd_fdstat_get"); - assert_ne!( - fdstat.fs_rights_base & wasi::RIGHTS_PATH_FILESTAT_GET, - 0, - "the scratch directory should have RIGHT_PATH_FILESTAT_GET as base right", - ); - } - // Create a file in the scratch directory. let file_fd = wasi::path_open( dir_fd, 0, "file", wasi::OFLAGS_CREAT, - wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE | wasi::RIGHTS_PATH_FILESTAT_GET, + wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE, 0, 0, ) diff --git a/test-programs/wasi-tests/src/config.rs b/test-programs/wasi-tests/src/config.rs index 0b223aca4b87..2c8e0c0f6832 100644 --- a/test-programs/wasi-tests/src/config.rs +++ b/test-programs/wasi-tests/src/config.rs @@ -3,7 +3,6 @@ pub struct TestConfig { no_dangling_filesystem: bool, no_rename_dir_to_empty_dir: bool, no_fdflags_sync_support: bool, - no_rights_readback_support: bool, } enum ErrnoMode { @@ -27,15 +26,11 @@ impl TestConfig { let no_dangling_filesystem = std::env::var("NO_DANGLING_FILESYSTEM").is_ok(); let no_rename_dir_to_empty_dir = std::env::var("NO_RENAME_DIR_TO_EMPTY_DIR").is_ok(); let no_fdflags_sync_support = std::env::var("NO_FDFLAGS_SYNC_SUPPORT").is_ok(); - // Current support for rights readback is buggy, lets ignore that in tests and get - // everything working first: - let no_rights_readback_support = std::env::var("NO_RIGHTS_READBACK_SUPPORT").is_ok(); TestConfig { errno_mode, no_dangling_filesystem, no_rename_dir_to_empty_dir, no_fdflags_sync_support, - no_rights_readback_support, } } pub fn errno_expect_unix(&self) -> bool { @@ -65,9 +60,4 @@ impl TestConfig { pub fn support_fdflags_sync(&self) -> bool { !self.no_fdflags_sync_support } - // Current support for rights readback is buggy, lets ignore that in tests and get - // everything working first: - pub fn support_rights_readback(&self) -> bool { - !self.no_rights_readback_support - } }