diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-09-25 16:06:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-25 16:06:07 +0000 |
commit | b9d77796c0e011e6337f5c173bb633ebcae863f9 (patch) | |
tree | 4080d9269f8ca07b3e079e64dfc1f1fdb3b1e22b /test/system/helpers.bash | |
parent | 2583246a17e40af3a3227f24daeb7b081f1c3d55 (diff) | |
parent | bd3c66fc8151350ad6562959054eddb5508cf028 (diff) | |
download | podman-b9d77796c0e011e6337f5c173bb633ebcae863f9.tar.gz podman-b9d77796c0e011e6337f5c173bb633ebcae863f9.tar.bz2 podman-b9d77796c0e011e6337f5c173bb633ebcae863f9.zip |
Merge pull request #7687 from edsantiago/bats
system tests: new tests
Diffstat (limited to 'test/system/helpers.bash')
-rw-r--r-- | test/system/helpers.bash | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/test/system/helpers.bash b/test/system/helpers.bash index 112b73962..78571901d 100644 --- a/test/system/helpers.bash +++ b/test/system/helpers.bash @@ -7,7 +7,7 @@ PODMAN=${PODMAN:-podman} PODMAN_TEST_IMAGE_REGISTRY=${PODMAN_TEST_IMAGE_REGISTRY:-"quay.io"} PODMAN_TEST_IMAGE_USER=${PODMAN_TEST_IMAGE_USER:-"libpod"} PODMAN_TEST_IMAGE_NAME=${PODMAN_TEST_IMAGE_NAME:-"testimage"} -PODMAN_TEST_IMAGE_TAG=${PODMAN_TEST_IMAGE_TAG:-"20200902"} +PODMAN_TEST_IMAGE_TAG=${PODMAN_TEST_IMAGE_TAG:-"20200917"} PODMAN_TEST_IMAGE_FQN="$PODMAN_TEST_IMAGE_REGISTRY/$PODMAN_TEST_IMAGE_USER/$PODMAN_TEST_IMAGE_NAME:$PODMAN_TEST_IMAGE_TAG" # Because who wants to spell that out each time? @@ -402,6 +402,35 @@ function random_string() { } +########################### +# random_rfc1918_subnet # +########################### +# +# Use the class B set, because much of our CI environment (Google, RH) +# already uses up much of the class A, and it's really hard to test +# if a block is in use. +# +# This returns THREE OCTETS! It is up to our caller to append .0/24, .255, &c. +# +function random_rfc1918_subnet() { + local retries=1024 + + while [ "$retries" -gt 0 ];do + local cidr=172.$(( 16 + $RANDOM % 16 )).$(( $RANDOM & 255 )) + + in_use=$(ip route list | fgrep $cidr) + if [ -z "$in_use" ]; then + echo "$cidr" + return + fi + + retries=$(( retries - 1 )) + done + + die "Could not find a random not-in-use rfc1918 subnet" +} + + ######################### # find_exec_pid_files # Returns nothing or exec_pid hash files ######################### |