Skip to content

Commit 50c2f55

Browse files
committed
wasix: cover unlink repro in standalone harness
1 parent 6e66211 commit 50c2f55

4 files changed

Lines changed: 17 additions & 62 deletions

File tree

lib/wasix/tests/wasm_tests/fd_tests.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,3 @@ fn test_fd_allocate() {
55
let wasm = run_build_script(file!(), "fd-allocate").unwrap();
66
run_wasm(&wasm, wasm.parent().unwrap()).unwrap();
77
}
8-
9-
#[test]
10-
fn test_unlink_open_fd_write_after_unlink() {
11-
let wasm = run_build_script(file!(), "unlink-open-fd-write-after-unlink").unwrap();
12-
run_wasm(&wasm, wasm.parent().unwrap()).unwrap();
13-
}

lib/wasix/tests/wasm_tests/fd_tests/unlink-open-fd-write-after-unlink/build.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/wasix/tests/wasm_tests/fd_tests/unlink-open-fd-write-after-unlink/main.c

Lines changed: 0 additions & 49 deletions
This file was deleted.

tests/wasix/unlink-open-fd-write-after-unlink/run.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,22 @@
22

33
set -euo pipefail
44

5+
assert_output() {
6+
local output_file="$1"
7+
8+
grep -Fx "open succeeded" "$output_file" >/dev/null
9+
grep -Fx "unlink succeeded" "$output_file" >/dev/null
10+
grep -Fx "fdopen succeeded" "$output_file" >/dev/null
11+
grep -Fx "writing succeeded" "$output_file" >/dev/null
12+
}
13+
514
$WASMER_RUN main.wasm > output
15+
assert_output output
16+
17+
rm -rf host-tmp
18+
mkdir -p host-tmp
19+
20+
$WASMER_RUN main.wasm --volume "$PWD/host-tmp:/tmp" > output-host
21+
assert_output output-host
622

7-
grep -Fx "open succeeded" output >/dev/null
8-
grep -Fx "unlink succeeded" output >/dev/null
9-
grep -Fx "fdopen succeeded" output >/dev/null
10-
grep -Fx "writing succeeded" output >/dev/null
23+
test ! -e host-tmp/test.txt

0 commit comments

Comments
 (0)