From 5836b1533a8d3cbe4dac7ad90c862948dadb1fbc Mon Sep 17 00:00:00 2001 From: Russell Bryant <rbryant@redhat.com> Date: Fri, 24 Feb 2012 10:23:33 -0500 Subject: [PATCH] Wait for VM to stop before deleting security group. Related to bug 938853. The patch for this bug prevents deleting security groups through the OpenStack API if they are still in use. This patch for devstack updates the floating_ips exercise script to wait until the VM has stopped before deleting the security group. Change-Id: If42f85934c2b92d4d001c419cabb09e2e3dc1aae --- exercises/floating_ips.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh index 233313e829..b559965fc9 100755 --- a/exercises/floating_ips.sh +++ b/exercises/floating_ips.sh @@ -195,8 +195,11 @@ nova floating-ip-delete $TEST_FLOATING_IP # shutdown the server nova delete $VM_UUID +# make sure the VM shuts down within a reasonable time +if ! timeout $TERMINATE_TIMEOUT sh -c "while nova show $VM_UUID | grep status | grep -q ACTIVE; do sleep 1; done"; then + echo "server didn't shut down!" + exit 1 +fi + # Delete a secgroup nova secgroup-delete $SECGROUP - -# FIXME: validate shutdown within 5 seconds -# (nova show $NAME returns 1 or status != ACTIVE)?