Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*nix test for opening /dev/* #514

Open
kubkon opened this issue Oct 24, 2019 · 0 comments · May be fixed by #10137
Open

*nix test for opening /dev/* #514

kubkon opened this issue Oct 24, 2019 · 0 comments · May be fixed by #10137
Labels
wasi:tests Issues pertaining to WASI tests in Wasmtime

Comments

@kubkon
Copy link
Member

kubkon commented Oct 24, 2019

Assuming that the Wasm app was given necessary capabilities (in this case, access to /dev/ dir), ensure that it is possible to properly open misc devices such as:

  • /dev/random
  • /dev/urandom
  • /dev/zero
  • /dev/null

Relevant PRs that spotted and/or fixed the bug:

@sunfishcode sunfishcode transferred this issue from CraneStation/wasi-misc-tests Nov 7, 2019
@kubkon kubkon transferred this issue from CraneStation/wasi-common Nov 8, 2019
@kubkon kubkon added the wasi:tests Issues pertaining to WASI tests in Wasmtime label Nov 8, 2019
erikrose added a commit to erikrose/wasmtime that referenced this issue Jan 28, 2025
Fixes bytecodealliance#514, but CI is grumpy and I have questions.

Both the sync and async variants run by `cargo test -p wasi-common preview1_device_read` work and are valid.

However, `foreach_preview1!(assert_test_exists)` fails its assertions when I run `ci/run-tests.sh` unless I repeat my tests in `wasi` (commented out here) as well as `wasi-common`. Is that the intent? I'm not sure what value such repetition has for this test. Perhaps I'm adding tests in the wrong place altogether. I welcome any illumination!

Note that I've hard-coded a "/dev" preopen into the test harnesses temporarily. Once I'm sure I'm adding to the right set of tests, I'll refactor to pass it only for this new one.
erikrose added a commit to erikrose/wasmtime that referenced this issue Jan 28, 2025
Fixes bytecodealliance#514, but CI is grumpy and I have questions.

Both the sync and async variants run by `cargo test -p wasi-common preview1_device_read` work and are valid.

However, `foreach_preview1!(assert_test_exists)` fails its assertions when I run `ci/run-tests.sh` unless I repeat my tests in `wasi` (commented out here) as well as `wasi-common`. Is that the intent? I'm not sure what value such repetition has for this test. Perhaps I'm adding tests in the wrong place altogether. I welcome any illumination!

Note that I've hard-coded a "/dev" preopen into the test harnesses temporarily. Once I'm sure I'm adding to the right set of tests, I'll refactor to pass it only for this new one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasi:tests Issues pertaining to WASI tests in Wasmtime
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant