diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-09-08 14:48:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-08 14:48:24 -0400 |
commit | 26c8549ae3d4f5c3742d006e40a51080d5ae0746 (patch) | |
tree | fd5100db6dc89b39e55340a1a0562d92dea45067 /test/system/500-networking.bats | |
parent | 400799b58cd2c67aea4754d370415081e2d303c6 (diff) | |
parent | 1ff797e3621e7e370f53c4c71c9f40bb6a878936 (diff) | |
download | podman-26c8549ae3d4f5c3742d006e40a51080d5ae0746.tar.gz podman-26c8549ae3d4f5c3742d006e40a51080d5ae0746.tar.bz2 podman-26c8549ae3d4f5c3742d006e40a51080d5ae0746.zip |
Merge pull request #11486 from edsantiago/bats
system tests: new random_free_port helper
Diffstat (limited to 'test/system/500-networking.bats')
-rw-r--r-- | test/system/500-networking.bats | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats index 3ebe45e63..ad5891dd9 100644 --- a/test/system/500-networking.bats +++ b/test/system/500-networking.bats @@ -23,7 +23,7 @@ load helpers random_1=$(random_string 30) random_2=$(random_string 30) - HOST_PORT=8080 + HOST_PORT=$(random_free_port) SERVER=http://127.0.0.1:$HOST_PORT # Create a test file with random content @@ -114,11 +114,8 @@ load helpers # Issue #5466 - port-forwarding doesn't work with this option and -d @test "podman networking: port with --userns=keep-id" { - # FIXME: randomize port, and create second random host port - myport=54321 - for cidr in "" "$(random_rfc1918_subnet).0/24"; do - myport=$(( myport + 1 )) + myport=$(random_free_port 52000-52999) if [[ -z $cidr ]]; then # regex to match that we are in 10.X subnet match="10\..*" @@ -188,6 +185,7 @@ load helpers # "network create" now works rootless, with the help of a special container @test "podman network create" { + # Deliberately use a fixed port, not random_open_port, because of #10806 myport=54322 local mynetname=testnet-$(random_string 10) @@ -244,7 +242,7 @@ load helpers skip_if_remote "podman network reload does not have remote support" random_1=$(random_string 30) - HOST_PORT=12345 + HOST_PORT=$(random_free_port) SERVER=http://127.0.0.1:$HOST_PORT # Create a test file with random content @@ -396,7 +394,7 @@ load helpers # Test for https://github.com/containers/podman/issues/10052 @test "podman network connect/disconnect with port forwarding" { random_1=$(random_string 30) - HOST_PORT=12345 + HOST_PORT=$(random_free_port) SERVER=http://127.0.0.1:$HOST_PORT # Create a test file with random content |