diff --git a/.github/workflows/wasi.yml b/.github/workflows/wasi.yml index 8d623d60654..d9decf5aae1 100644 --- a/.github/workflows/wasi.yml +++ b/.github/workflows/wasi.yml @@ -62,7 +62,7 @@ jobs: # not(wasi_runner) in the cfg guarding every `mod diagnostics`. # TODO: add integration tests for these tools as WASI support is extended: # cksum csplit dircolors fmt ls mv readlink - # realpath rm seq sort split tsort + # rm seq sort split tsort # nproc is not part of the default feature set, so it needs to be # requested explicitly for the host test crate to compile its tests. UUTESTS_BINARY_PATH="$(pwd)/target/${{ matrix.job.target }}/debug/coreutils.wasm" \ @@ -76,7 +76,7 @@ jobs: test_ls::test_ls_al_no_capabilities_insufficient_on_wasi \ test_md5sum:: test_mkdir:: test_mktemp:: test_nl:: test_nproc:: test_numfmt:: test_od:: \ test_paste:: test_pathchk:: test_pr:: test_printenv:: test_printf:: test_ptx:: \ - test_pwd:: test_rmdir:: test_sha1sum:: test_sha224sum:: test_sha256sum:: \ + test_pwd:: test_realpath:: test_rmdir:: test_sha1sum:: test_sha224sum:: test_sha256sum:: \ test_sha384sum:: test_sha512sum:: test_shred:: test_shuf:: test_sleep:: \ test_sum:: test_tail:: test_tee:: \ test_test:: test_touch:: test_tr:: test_true:: test_truncate:: test_uname:: \ diff --git a/tests/by-util/test_realpath.rs b/tests/by-util/test_realpath.rs index 1e143ecefe2..14d67f57143 100644 --- a/tests/by-util/test_realpath.rs +++ b/tests/by-util/test_realpath.rs @@ -17,6 +17,7 @@ use std::path::{MAIN_SEPARATOR, Path}; static GIBBERISH: &str = "supercalifragilisticexpialidocious"; #[test] +#[cfg_attr(wasi_runner, ignore = "WASI sandbox: host paths not visible")] fn test_realpath_current_directory() { let (at, mut ucmd) = at_and_ucmd!(); let expect = at.root_dir_resolved() + "\n"; @@ -24,6 +25,7 @@ fn test_realpath_current_directory() { } #[test] +#[cfg_attr(wasi_runner, ignore = "WASI sandbox: host paths not visible")] fn test_realpath_long_redirection_to_current_dir() { let (at, mut ucmd) = at_and_ucmd!(); // Create a 256-character path to current directory @@ -41,6 +43,7 @@ fn test_realpath_long_redirection_to_root() { } #[test] +#[cfg_attr(wasi_runner, ignore = "WASI sandbox: absolute symlink targets")] fn test_realpath_file_and_links() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; @@ -53,6 +56,7 @@ fn test_realpath_file_and_links() { } #[test] +#[cfg_attr(wasi_runner, ignore = "WASI sandbox: absolute symlink targets")] fn test_realpath_file_and_links_zero() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; @@ -130,6 +134,7 @@ fn test_realpath_file_and_links_strip_zero() { } #[test] +#[cfg_attr(wasi_runner, ignore = "WASI sandbox: absolute symlink targets")] fn test_realpath_physical_mode() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; @@ -163,6 +168,7 @@ fn test_realpath_logical_mode() { } #[test] +#[cfg_attr(wasi_runner, ignore = "WASI sandbox: host paths not visible")] fn test_realpath_dangling() { let (at, mut ucmd) = at_and_ucmd!(); at.symlink_file("nonexistent-file", "link"); @@ -178,6 +184,7 @@ fn test_realpath_dangling() { } #[test] +#[cfg_attr(wasi_runner, ignore = "WASI sandbox: absolute symlink targets")] fn test_realpath_loop() { let (at, mut ucmd) = at_and_ucmd!(); at.symlink_file("2", "1"); @@ -225,6 +232,7 @@ fn test_realpath_symlink_follow_limit() { } #[test] +#[cfg_attr(wasi_runner, ignore = "WASI sandbox: host paths not visible")] fn test_realpath_default_allows_final_non_existent() { let p = Path::new("").join(GIBBERISH); let (at, mut ucmd) = at_and_ucmd!(); @@ -239,6 +247,7 @@ fn test_realpath_default_forbids_non_final_non_existent() { } #[test] +#[cfg_attr(wasi_runner, ignore = "WASI sandbox: host paths not visible")] fn test_realpath_existing() { let (at, mut ucmd) = at_and_ucmd!(); ucmd.arg("-e") @@ -261,6 +270,7 @@ fn test_realpath_existing_error_quiet() { } #[test] +#[cfg_attr(wasi_runner, ignore = "WASI sandbox: host paths not visible")] fn test_realpath_missing() { let p = Path::new("").join(GIBBERISH).join(GIBBERISH); let (at, mut ucmd) = at_and_ucmd!(); @@ -272,6 +282,7 @@ fn test_realpath_missing() { } #[test] +#[cfg_attr(wasi_runner, ignore = "WASI sandbox: host paths not visible")] fn test_realpath_when_symlink_is_absolute_and_enoent() { let (at, mut ucmd) = at_and_ucmd!(); @@ -303,6 +314,7 @@ fn test_realpath_when_symlink_is_absolute_and_enoent() { } #[test] +#[cfg_attr(wasi_runner, ignore = "WASI sandbox: absolute symlink targets")] fn test_realpath_when_symlink_part_is_missing() { let (at, mut ucmd) = at_and_ucmd!(); @@ -557,6 +569,7 @@ fn test_realpath_empty() { #[test] #[cfg(target_os = "linux")] +#[cfg_attr(wasi_runner, ignore = "WASI: argv/filenames must be valid UTF-8")] fn test_realpath_non_utf8_paths() { use std::ffi::OsStr; use std::os::unix::ffi::OsStrExt;