Browse code

Merge "Wait for VM to stop before deleting security group."

Jenkins authored on 2012/02/25 06:56:22
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)?