diff options
author | blsaws <bryan.sullivan@att.com> | 2016-07-27 17:43:48 -0700 |
---|---|---|
committer | blsaws <bryan.sullivan@att.com> | 2016-07-27 17:43:48 -0700 |
commit | 67a78a8513ac023bfc834b4a71d67340eac75fe0 (patch) | |
tree | 88ec8f51f298b02d7fd33ccb44a763fd2f808de0 /tests/adhoc/smoke01-clean.sh | |
parent | 424b45cfac614ce90a98a1fa9f10d1e4e8152544 (diff) |
Fix use of floating IP, add delays to avoid errors...
JIRA: COPPER-4
Change-Id: I738131f9b0b4ca0a25cd87c90bb29a452a708616
Signed-off-by: blsaws <bryan.sullivan@att.com>
Diffstat (limited to 'tests/adhoc/smoke01-clean.sh')
-rw-r--r-- | tests/adhoc/smoke01-clean.sh | 26 |
1 files changed, 20 insertions, 6 deletions
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 }") |