aboutsummaryrefslogtreecommitdiff
path: root/tests/test-octavia.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-octavia.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-octavia.sh')
-rw-r--r--tests/test-octavia.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test-octavia.sh b/tests/test-octavia.sh
index cc033ac5a..032230bbe 100644
--- a/tests/test-octavia.sh
+++ b/tests/test-octavia.sh
@@ -58,6 +58,17 @@ function test_octavia {
# Add a floating IP to the load balancer.
lb_fip=$(openstack floating ip create public1 -f value -c name)
lb_vip=$(openstack loadbalancer show lb -f value -c vip_address)
+ attempt=0
+ while [[ $(openstack port list --fixed-ip ip-address=$lb_vip -f value -c ID) == "" ]]; do
+ echo "Port for LB with VIP ip addr $lb_vip not available yet"
+ attempt=$((attempt+1))
+ if [[ $attempt -eq 10 ]]; then
+ echo "ERROR: Port for LB with VIP ip addr failed to become available"
+ openstack port list --fixed-ip ip-address=$lb_vip
+ return 1
+ fi
+ sleep $attempt
+ done
lb_port_id=$(openstack port list --fixed-ip ip-address=$lb_vip -f value -c ID)
openstack floating ip set $lb_fip --port $lb_port_id
@@ -124,6 +135,17 @@ function test_internal_dns_integration {
openstack server create --image cirros --flavor m1.tiny --network dns-test-network ${SERVER_NAME}
SERVER_ID=$(openstack server show ${SERVER_NAME} -f value -c id)
+ attempt=0
+ while [[ $(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)
DNS_ASSIGNMENT=$(openstack port show ${PORT_ID} -f json -c dns_assignment)