Browse code

Merge "Modify euca test to get zone using describe"

Jenkins authored on 2012/09/25 06:34:24
Showing 1 changed files
... ...
@@ -24,7 +24,6 @@ set -o xtrace
24 24
 # Keep track of the current directory
25 25
 EXERCISE_DIR=$(cd $(dirname "$0") && pwd)
26 26
 TOP_DIR=$(cd $EXERCISE_DIR/..; pwd)
27
-VOLUME_ZONE=nova
28 27
 VOLUME_SIZE=1
29 28
 ATTACH_DEVICE=/dev/vdc
30 29
 
... ...
@@ -75,11 +74,15 @@ fi
75 75
 # Volumes
76 76
 # -------
77 77
 if [[ "$ENABLED_SERVICES" =~ "n-vol" || "$ENABLED_SERVICES" =~ "c-vol" ]]; then
78
+   VOLUME_ZONE=`euca-describe-availability-zones | head -n1 | cut -f2`
79
+   die_if_not_set VOLUME_ZONE "Failure to find zone for volume"
80
+
78 81
    VOLUME=`euca-create-volume -s 1 -z $VOLUME_ZONE | cut -f2`
79 82
    die_if_not_set VOLUME "Failure to create volume"
80 83
 
81 84
    # Test that volume has been created
82 85
    VOLUME=`euca-describe-volumes | cut -f2`
86
+   die_if_not_set VOLUME "Failure to get volume"
83 87
 
84 88
    # Test volume has become available
85 89
    if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -q available; do sleep 1; done"; then