summaryrefslogtreecommitdiff
path: root/test/system/500-networking.bats
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-06-24 15:21:27 +0200
committerPaul Holzinger <pholzing@redhat.com>2022-06-27 14:25:24 +0200
commit345778ece0eac49fe49e68a2dd2bb301c975c5af (patch)
treeb21809bf3bd4c5b8bfd59f732605b52058c4cea2 /test/system/500-networking.bats
parent3176b3fe011aa3323ba192e90efe516d0701e46e (diff)
downloadpodman-345778ece0eac49fe49e68a2dd2bb301c975c5af.tar.gz
podman-345778ece0eac49fe49e68a2dd2bb301c975c5af.tar.bz2
podman-345778ece0eac49fe49e68a2dd2bb301c975c5af.zip
Fix "podman run port forward range" flake
The test must ensure that all ports in the range are free not just the first. This flakes often because port 5355 is always in use by systemd-resolved on fedora. Fixes #14716 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test/system/500-networking.bats')
-rw-r--r--test/system/500-networking.bats8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index fb785177c..0d724985e 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -676,12 +676,12 @@ EOF
@test "podman run port forward range" {
for netmode in bridge slirp4netns:port_handler=slirp4netns slirp4netns:port_handler=rootlesskit; do
- local port=$(random_free_port)
- local end_port=$(( $port + 2 ))
- local range="$port-$end_port:$port-$end_port"
+ local range=$(random_free_port_range 3)
+ local port="${test%-*}"
+ local end_port="${test#-*}"
local random=$(random_string)
- run_podman run --network $netmode -p "$range" -d $IMAGE sleep inf
+ run_podman run --network $netmode -p "$range:$range" -d $IMAGE sleep inf
cid="$output"
for port in $(seq $port $end_port); do
run_podman exec -d $cid nc -l -p $port -e /bin/cat