diff options
author | Ed Santiago <santiago@redhat.com> | 2021-09-08 10:57:24 -0600 |
---|---|---|
committer | Ed Santiago <santiago@redhat.com> | 2021-09-08 11:25:42 -0600 |
commit | 1ff797e3621e7e370f53c4c71c9f40bb6a878936 (patch) | |
tree | 0e39a0e3ba4348e05b157253d042b4366f7dc74d /test/system/helpers.t | |
parent | d68e429859b497cd31c6e3dfdc64dce58b0b95d5 (diff) | |
download | podman-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/helpers.t')
-rwxr-xr-x | test/system/helpers.t | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/system/helpers.t b/test/system/helpers.t index 190e8ba35..b83d9a89b 100755 --- a/test/system/helpers.t +++ b/test/system/helpers.t @@ -213,8 +213,16 @@ declare -a lines=( ) check_same_dev "zero-line output" - # END remove_same_dev_warning ############################################################################### +# BEGIN random_free_port + +# Assumes that 16700 is open +found=$(random_free_port 16700-16700) + +check_result "$found" "16700" "random_free_port" + +# END random_free_port +############################################################################### exit $rc |