summaryrefslogtreecommitdiff
path: root/lib9p/tests/runtest
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/tests/runtest')
-rwxr-xr-xlib9p/tests/runtest5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib9p/tests/runtest b/lib9p/tests/runtest
index c2f6c41..3a46f28 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")