diff options
Diffstat (limited to 'lib9p/tests/runtest')
-rwxr-xr-x | lib9p/tests/runtest | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib9p/tests/runtest b/lib9p/tests/runtest index c2f6c41..a745f12 100755 --- a/lib9p/tests/runtest +++ b/lib9p/tests/runtest @@ -7,11 +7,12 @@ set -euE -o pipefail set -x -valgrind --error-exitcode=2 ./tests/test_server/test_server & +port=$(python -c 'import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()') +valgrind --error-exitcode=2 ./tests/test_server/test_server "$port" & server_pid=$! # shellcheck disable=SC2064 trap "kill $server_pid || true; wait $server_pid || true" EXIT -server_addr='localhost:9000' +server_addr="localhost:${port}" client=(9p -a "$server_addr") @@ -31,7 +32,7 @@ expect_lines \ out=$("${client[@]}" ls -l 'Documentation/') expect_lines \ - '--r--r--r-- M 0 root root 162 Oct 7 15:51 x' + '--r--r--r-- M 0 root root 166 Oct 7 15:51 x' out=$("${client[@]}" read 'README.md') expect_lines \ @@ -46,7 +47,7 @@ expect_lines \ out=$("${client[@]}" read 'Documentation/x') expect_lines \ '<!--' \ - ' Documentation/x - test static file' \ + ' Documentation/x.txt - test static file' \ '' \ ' Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com>' \ ' SPDX-License-Identifier: AGPL-3.0-or-later' \ @@ -55,7 +56,7 @@ expect_lines \ out=$("${client[@]}" stat 'Documentation/x') expect_lines \ - "'x' 'root' 'root' 'root' q (0000000000000001 1 ) m 0444 at 1728337905 mt 1728337904 l 162 t 0 d 0" + "'x' 'root' 'root' 'root' q (0000000000000001 1 ) m 0444 at 1728337905 mt 1728337904 l 166 t 0 d 0" out=$("${client[@]}" write 'shutdown' <<<1) expect_lines '' |