Browse code

Fix aggregates test with multi host setup

Fixes bug 1046222.

The aggregate exercise assumed that you have only one compute node, thus
it failed with syntax error for two hosts. With this fix, the exercise
will pick the first compute host, and use that for the tests.

Change-Id: I85d76552295d640e1a9d86fbbed781f15529d047

Mate Lakat authored on 2012/09/05 18:42:10
Showing 1 changed files
... ...
@@ -125,16 +125,16 @@ nova aggregate-details $AGGREGATE_ID | grep {}
125 125
 if [ "$VIRT_DRIVER" == "xenserver" ]; then
126 126
     echo "TODO(johngarbutt) add tests for add/remove host from pool aggregate"
127 127
 fi
128
-HOST=`nova host-list | grep compute | get_field 1`
128
+FIRST_HOST=`nova host-list | grep compute | get_field 1 | head -1`
129 129
 # Make sure can add two aggregates to same host
130
-nova aggregate-add-host $AGGREGATE_ID $HOST
131
-nova aggregate-add-host $AGGREGATE2_ID $HOST
132
-if nova aggregate-add-host $AGGREGATE2_ID $HOST; then
130
+nova aggregate-add-host $AGGREGATE_ID $FIRST_HOST
131
+nova aggregate-add-host $AGGREGATE2_ID $FIRST_HOST
132
+if nova aggregate-add-host $AGGREGATE2_ID $FIRST_HOST; then
133 133
     echo "ERROR could add duplicate host to single aggregate"
134 134
     exit -1
135 135
 fi
136
-nova aggregate-remove-host $AGGREGATE2_ID $HOST
137
-nova aggregate-remove-host $AGGREGATE_ID $HOST
136
+nova aggregate-remove-host $AGGREGATE2_ID $FIRST_HOST
137
+nova aggregate-remove-host $AGGREGATE_ID $FIRST_HOST
138 138
 
139 139
 # Test aggregate-delete
140 140
 # =====================