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
This commit is contained in:
Adam Gandelman 2013-01-04 13:37:22 -08:00
parent 822d9b6c99
commit 756c842a77

View File

@ -192,7 +192,7 @@ echo "Completed volume-detach in $((end_time - start_time)) seconds"
# Delete volume # Delete volume
start_time=`date +%s` start_time=`date +%s`
cinder delete $VOL_ID || die "Failure deleting volume $VOL_NAME" cinder delete $VOL_ID || die "Failure deleting volume $VOL_NAME"
if ! timeout $ACTIVE_TIMEOUT sh -c "while ! cinder list | grep $VOL_NAME; do sleep 1; done"; then if ! timeout $ACTIVE_TIMEOUT sh -c "while cinder list | grep $VOL_NAME; do sleep 1; done"; then
echo "Volume $VOL_NAME not deleted" echo "Volume $VOL_NAME not deleted"
exit 1 exit 1
fi fi