aboutsummaryrefslogtreecommitdiff
path: root/tests/test-magnum.sh
diff options
context:
space:
mode:
authorMichal Nasiadka <mnasiadka@gmail.com>2024-07-19 14:32:52 +0200
committerMichal Nasiadka <mnasiadka@gmail.com>2024-08-08 09:22:18 +0000
commit19804048ebf208e83265270ce6b9b515951f7f39 (patch)
treea8143a29d675dc30a43b7281ed7708de2cabd2f5 /tests/test-magnum.sh
parent9a5059d4408a11f23c23f2543c404292ac9d088a (diff)
downloadkolla-ansible-19804048ebf208e83265270ce6b9b515951f7f39.tar.gz
kolla-ansible-19804048ebf208e83265270ce6b9b515951f7f39.zip
CI: Fix cases where port is not available yet
Closes-Bug: #2075966 Change-Id: I6ed82ecc7ca82c09aacb2a65254f794c72365188
Diffstat (limited to 'tests/test-magnum.sh')
-rwxr-xr-xtests/test-magnum.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test-magnum.sh b/tests/test-magnum.sh
index df4352c12..6d580a856 100755
--- a/tests/test-magnum.sh
+++ b/tests/test-magnum.sh
@@ -61,6 +61,17 @@ function test_designate {
openstack server create --image cirros --flavor m1.tiny --network tenant-dns-test ${SERVER_NAME}
SERVER_ID=$(openstack server show ${SERVER_NAME} -f value -c id)
+ attempt=0
+ while [[ -z $(openstack port list --device-id ${SERVER_ID} -f value -c ID) ]]; do
+ echo "Port for server ${SERVER_NAME} not available yet"
+ attempt=$((attempt+1))
+ if [[ $attempt -eq 10 ]]; then
+ echo "ERROR: Port for server ${SERVER_NAME} failed to become available"
+ openstack port list --device-id ${SERVER_ID}
+ return 1
+ fi
+ sleep $attempt
+ done
PORT_ID=$(openstack port list --device-id ${SERVER_ID} -f value -c ID)
openstack floating ip create public1 --port ${PORT_ID}