Browse code

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

Russell Bryant authored on 2012/02/25 00:23:33
Showing 1 changed files
... ...
@@ -195,8 +195,11 @@ nova floating-ip-delete $TEST_FLOATING_IP
195 195
 # shutdown the server
196 196
 nova delete $VM_UUID
197 197
 
198
+# make sure the VM shuts down within a reasonable time
199
+if ! timeout $TERMINATE_TIMEOUT sh -c "while nova show $VM_UUID | grep status | grep -q ACTIVE; do sleep 1; done"; then
200
+    echo "server didn't shut down!"
201
+    exit 1
202
+fi
203
+
198 204
 # Delete a secgroup
199 205
 nova secgroup-delete $SECGROUP
200
-
201
-# FIXME: validate shutdown within 5 seconds
202
-# (nova show $NAME returns 1 or status != ACTIVE)?