From dc9e2880a3510205f3e2d0a7db3185005303b42d Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Fri, 21 Sep 2012 23:20:06 +0000 Subject: [PATCH] Modify euca test to get zone using describe This modifies the euca test to include describe-availability-zones so that it is covered. This allows us to not need to hard-code a zone name for the volume tests. Change-Id: Iaae0589d4338d948981ca6e2229d2ceb73ff38ef --- exercises/euca.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/exercises/euca.sh b/exercises/euca.sh index fd11622722..58b5d9143d 100755 --- a/exercises/euca.sh +++ b/exercises/euca.sh @@ -24,7 +24,6 @@ set -o xtrace # Keep track of the current directory EXERCISE_DIR=$(cd $(dirname "$0") && pwd) TOP_DIR=$(cd $EXERCISE_DIR/..; pwd) -VOLUME_ZONE=nova VOLUME_SIZE=1 ATTACH_DEVICE=/dev/vdc @@ -75,11 +74,15 @@ fi # Volumes # ------- if [[ "$ENABLED_SERVICES" =~ "n-vol" || "$ENABLED_SERVICES" =~ "c-vol" ]]; then + VOLUME_ZONE=`euca-describe-availability-zones | head -n1 | cut -f2` + die_if_not_set VOLUME_ZONE "Failure to find zone for volume" + VOLUME=`euca-create-volume -s 1 -z $VOLUME_ZONE | cut -f2` die_if_not_set VOLUME "Failure to create volume" # Test that volume has been created VOLUME=`euca-describe-volumes | cut -f2` + die_if_not_set VOLUME "Failure to get volume" # Test volume has become available if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -q available; do sleep 1; done"; then