From 178b8402d962d629dbaffea8e2c454f391a16331 Mon Sep 17 00:00:00 2001 From: Mate Lakat Date: Wed, 5 Sep 2012 10:42:10 +0100 Subject: [PATCH] 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 --- exercises/aggregates.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/exercises/aggregates.sh b/exercises/aggregates.sh index 8a4f9c19fa..adc3393bb6 100755 --- a/exercises/aggregates.sh +++ b/exercises/aggregates.sh @@ -125,16 +125,16 @@ nova aggregate-details $AGGREGATE_ID | grep {} if [ "$VIRT_DRIVER" == "xenserver" ]; then echo "TODO(johngarbutt) add tests for add/remove host from pool aggregate" fi -HOST=`nova host-list | grep compute | get_field 1` +FIRST_HOST=`nova host-list | grep compute | get_field 1 | head -1` # Make sure can add two aggregates to same host -nova aggregate-add-host $AGGREGATE_ID $HOST -nova aggregate-add-host $AGGREGATE2_ID $HOST -if nova aggregate-add-host $AGGREGATE2_ID $HOST; then +nova aggregate-add-host $AGGREGATE_ID $FIRST_HOST +nova aggregate-add-host $AGGREGATE2_ID $FIRST_HOST +if nova aggregate-add-host $AGGREGATE2_ID $FIRST_HOST; then echo "ERROR could add duplicate host to single aggregate" exit -1 fi -nova aggregate-remove-host $AGGREGATE2_ID $HOST -nova aggregate-remove-host $AGGREGATE_ID $HOST +nova aggregate-remove-host $AGGREGATE2_ID $FIRST_HOST +nova aggregate-remove-host $AGGREGATE_ID $FIRST_HOST # Test aggregate-delete # =====================