From c2fc5f890ee5cdc7f4f3957b61d4237bd1abda38 Mon Sep 17 00:00:00 2001 From: Chris Yeoh Date: Mon, 22 Apr 2013 10:33:07 +0930 Subject: [PATCH] Fix attach volume detect in euca test Fixes test for detecting when a volume has been successfully attached to an instance to not just rely on the state being in-use, but also be marked as "attached". The attachment state will be displayed when https://review.openstack.org/#/c/27098/ goes through. The attachment state is not currently displayed by euca-describe-volumes because of the extraneous data returned by the API as per bug #1074901. In the meantime the "attaching" status of the volume itself, rather than the attachment state, suffices for the test to work properly, but in the long term this will disappear as it is not a valid ec2 API state and volumes will move straight to the in-use state. Fixes bug #1170548 Change-Id: Id38f37e1a0efc991f60da35145f809d98b5f41cd --- exercises/euca.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/euca.sh b/exercises/euca.sh index 50d4744e69..d704279431 100755 --- a/exercises/euca.sh +++ b/exercises/euca.sh @@ -96,7 +96,7 @@ if [[ "$ENABLED_SERVICES" =~ "c-vol" ]]; then # Attach volume to an instance euca-attach-volume -i $INSTANCE -d $ATTACH_DEVICE $VOLUME || \ die $LINENO "Failure attaching volume $VOLUME to $INSTANCE" - if ! timeout $ACTIVE_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -q in-use; do sleep 1; done"; then + if ! timeout $ACTIVE_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -A 1 in-use | grep -q attach; do sleep 1; done"; then die $LINENO "Could not attach $VOLUME to $INSTANCE" fi