From 67a78a8513ac023bfc834b4a71d67340eac75fe0 Mon Sep 17 00:00:00 2001 From: blsaws Date: Wed, 27 Jul 2016 17:43:48 -0700 Subject: Fix use of floating IP, add delays to avoid errors... JIRA: COPPER-4 Change-Id: I738131f9b0b4ca0a25cd87c90bb29a452a708616 Signed-off-by: blsaws --- tests/adhoc/smoke01-clean.sh | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'tests/adhoc/smoke01-clean.sh') diff --git a/tests/adhoc/smoke01-clean.sh b/tests/adhoc/smoke01-clean.sh index c951911..3c4ebf3 100644 --- a/tests/adhoc/smoke01-clean.sh +++ b/tests/adhoc/smoke01-clean.sh @@ -27,9 +27,6 @@ wget https://git.opnfv.org/cgit/copper/plain/components/congress/install/bash/setenv.sh -O ~/setenv.sh source ~/setenv.sh -echo "Disassociate cirros1 floating IP address" -nova floating-ip-disassociate cirros1 192.168.10.6 - echo "Delete cirros1 instance" instance=$(nova list | awk "/ cirros1 / { print \$2 }") if [ "$instance" != "" ]; then nova delete $instance; fi @@ -38,14 +35,31 @@ echo "Delete cirros2 instance" instance=$(nova list | awk "/ cirros2 / { print \$2 }") if [ "$instance" != "" ]; then nova delete $instance; fi -echo "Delete smoke01 key pair" -nova keypair-delete smoke01 -rm /tmp/smoke01 +echo "Wait for cirros1 and cirros2 to terminate" +COUNTER=5 +RESULT="Wait!" +until [[ $COUNTER -eq 0 || $RESULT == "Go!" ]]; do + cirros1_id=$(openstack server list | awk "/ cirros1 / { print \$4 }") + cirros2_id=$(openstack server list | awk "/ cirros2 / { print \$4 }") + if [[ "$cirros1_id" == "" && "$cirros2_id" == "" ]]; then RESULT="Go!"; fi + let COUNTER-=1 + sleep 5 +done echo "Delete 'smoke01' security group" sg=$(neutron security-group-list | awk "/ smoke01 / { print \$2 }") neutron security-group-delete $sg +echo "Delete floating ip" +# FLOATING_IP_ID was saved by smoke01.sh +source /tmp/TEST_VARS.sh +rm /tmp/TEST_VARS.sh +neutron floatingip-delete $FLOATING_IP_ID + +echo "Delete smoke01 key pair" +nova keypair-delete smoke01 +rm /tmp/smoke01 + echo "Get 'public_router' ID" router=$(neutron router-list | awk "/ public_router / { print \$2 }") -- cgit 1.2.3-korg