-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3240: Fix filesystem rights on WASI, add integration test for file permissions r=Michael-F-Bryan a=fschutt Fixes #3125 Co-authored-by: Felix Schütt <[email protected]> Co-authored-by: Felix Schütt <[email protected]>
- Loading branch information
Showing
59 changed files
with
381 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,40 @@ | ||
pub static ALL_WASI_VERSIONS: &[WasiVersion] = &[WasiVersion::Unstable, WasiVersion::Snapshot1]; | ||
pub static LATEST_WASI_VERSION: &[WasiVersion] = &[WasiVersion::get_latest()]; | ||
pub static NIGHTLY_VERSION: &[WasiVersion] = &[WasiVersion::current_nightly()]; | ||
|
||
#[derive(Debug, Clone, Copy)] | ||
pub enum WasiVersion { | ||
/// A.K.A. Snapshot0 | ||
Unstable, | ||
Snapshot1, | ||
/// This is for making tests pass on Apple M1 while | ||
/// still keeping the old test for compatibility reasons | ||
#[allow(non_camel_case_types)] | ||
Nightly_2022_10_18, | ||
} | ||
|
||
impl WasiVersion { | ||
pub const fn get_latest() -> Self { | ||
Self::Snapshot1 | ||
} | ||
|
||
pub const fn current_nightly() -> Self { | ||
Self::Nightly_2022_10_18 | ||
} | ||
|
||
pub fn get_compiler_toolchain(&self) -> &'static str { | ||
match self { | ||
WasiVersion::Unstable => "nightly-2019-09-13", | ||
WasiVersion::Snapshot1 => "1.53.0", | ||
WasiVersion::Nightly_2022_10_18 => "nightly-2022-10-18", | ||
} | ||
} | ||
|
||
pub fn get_directory_name(&self) -> &'static str { | ||
match self { | ||
WasiVersion::Unstable => "unstable", | ||
WasiVersion::Snapshot1 => "snapshot1", | ||
WasiVersion::Nightly_2022_10_18 => "nightly_2022_10_18", | ||
} | ||
} | ||
} |
Binary file not shown.
7 changes: 7 additions & 0 deletions
7
tests/wasi-wast/wasi/nightly_2022_10_18/close_preopen_fd.wast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
;; This file was generated by https://github.com/wasmerio/wasi-tests | ||
|
||
(wasi_test "close_preopen_fd.wasm" | ||
(map_dirs "hamlet:test_fs/hamlet") | ||
(assert_return (i64.const 0)) | ||
(assert_stdout "accessing preopen fd was a success\nClosing preopen fd was a success\naccessing closed preopen fd was an EBADF error: true\n") | ||
) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
;; This file was generated by https://github.com/wasmerio/wasi-tests | ||
|
||
(wasi_test "create_dir.wasm" | ||
(preopens "test_fs") | ||
(assert_return (i64.const 0)) | ||
(assert_stdout "Test file exists: false\nDir exists: false\nDir exists: false\nDir exists: false\nSuccess\n") | ||
) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
;; This file was generated by https://github.com/wasmerio/wasi-tests | ||
|
||
(wasi_test "envvar.wasm" | ||
(envs "DOG=1" "CAT=2") | ||
(assert_return (i64.const 0)) | ||
(assert_stdout "Env vars:\nCAT=2\nDOG=1\nDOG Ok(\"1\")\nDOG_TYPE Err(NotPresent)\nSET VAR Ok(\"HELLO\")\n") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
;; This file was generated by https://github.com/wasmerio/wasi-tests | ||
|
||
(wasi_test "fd_allocate.wasm" | ||
(temp_dirs ".") | ||
(assert_return (i64.const 0)) | ||
(assert_stdout "171\n1405\n") | ||
) |
Binary file not shown.
Oops, something went wrong.