Browse code

Properly wait until volumes are gone in volumes.sh

A logic error in volume exercise's wait for volume deletion
causes the test to do the opopsite, and continue on even tho
the volume is in in the 'deleting' state. If using a volume
backend that can quickly delete volumes (ceph), and the volume
is gone before entering the wait, the loop will spin, timeout
and fail the test.

Change-Id: I8e3d2aaa04e6a165e0dee32bedac97d35e13d5eb
(cherry picked from commit 756c842a7743a84a084b4cc211998e3fdd171592)

Adam Gandelman authored on 2013/01/05 06:37:22
Showing 1 changed files
... ...
@@ -205,7 +205,7 @@ echo "Completed volume-detach in $((end_time - start_time)) seconds"
205 205
 # Delete volume
206 206
 start_time=`date +%s`
207 207
 nova volume-delete $VOL_ID || die "Failure deleting volume $VOL_NAME"
208
-if ! timeout $ACTIVE_TIMEOUT sh -c "while ! nova volume-list | grep $VOL_NAME; do sleep 1; done"; then
208
+if ! timeout $ACTIVE_TIMEOUT sh -c "while nova volume-list | grep $VOL_NAME; do sleep 1; done"; then
209 209
     echo "Volume $VOL_NAME not deleted"
210 210
     end_time=`date +%s`
211 211
     echo "Failed volume-delete after $((end_time - start_time)) seconds"