summaryrefslogtreecommitdiff
path: root/test/system/271-tcp-cors-server.bats
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2021-09-08 10:57:24 -0600
committerEd Santiago <santiago@redhat.com>2021-09-08 11:25:42 -0600
commit1ff797e3621e7e370f53c4c71c9f40bb6a878936 (patch)
tree0e39a0e3ba4348e05b157253d042b4366f7dc74d /test/system/271-tcp-cors-server.bats
parentd68e429859b497cd31c6e3dfdc64dce58b0b95d5 (diff)
downloadpodman-1ff797e3621e7e370f53c4c71c9f40bb6a878936.tar.gz
podman-1ff797e3621e7e370f53c4c71c9f40bb6a878936.tar.bz2
podman-1ff797e3621e7e370f53c4c71c9f40bb6a878936.zip
system tests: new random_free_port helper
Picks a pseudorandom open port within a range. Refactor existing instances of such code. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system/271-tcp-cors-server.bats')
-rw-r--r--test/system/271-tcp-cors-server.bats4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/system/271-tcp-cors-server.bats b/test/system/271-tcp-cors-server.bats
index cdfa82e82..d8e4eb3df 100644
--- a/test/system/271-tcp-cors-server.bats
+++ b/test/system/271-tcp-cors-server.bats
@@ -14,7 +14,7 @@ SOCKET_FILE="$UNIT_DIR/$SERVICE_NAME.socket"
@test "podman system service - tcp CORS" {
skip_if_remote "system service tests are meaningless over remote"
- PORT=$(( ((RANDOM<<15)|RANDOM) % 63001 + 2000 ))
+ PORT=$(random_free_port 63000-64999)
run_podman system service --cors="*" tcp:$SERVICE_TCP_HOST:$PORT -t 20 &
podman_pid="$!"
sleep 5s
@@ -26,7 +26,7 @@ SOCKET_FILE="$UNIT_DIR/$SERVICE_NAME.socket"
@test "podman system service - tcp without CORS" {
skip_if_remote "system service tests are meaningless over remote"
- PORT=$(( ((RANDOM<<15)|RANDOM) % 63001 + 2000 ))
+ PORT=$(random_free_port 63000-64999)
run_podman system service tcp:$SERVICE_TCP_HOST:$PORT -t 20 &
podman_pid="$!"
sleep 5s