Commit 1a3cc8ad authored by Iustin Pop's avatar Iustin Pop
Browse files

live-test: support multi-group clusters

Since currently hbal can only work on single groups at a time, we need
to be able to specify the target group when running the live test.
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarBalazs Lecz <>
parent 716c6be5
......@@ -26,10 +26,15 @@
# Use: if running on a cluster master, just running it should be
# enough. If running remotely, set env vars as follows: LUXI to the
# export unix socket, RAPI to the cluster IP, CLUSTER to the command
# used to login on the cluster (e.g. CLUSTER="ssh root@cluster").
# used to login on the cluster (e.g. CLUSTER="ssh root@cluster"). Note
# that when run against a multi-group cluster, the GROUP variable
# should be set to one of the groups (some operations work only on one
# group)
set -e
: ${RAPI:=localhost}
T=`mktemp -d`
trap 'rm -rf $T' EXIT
echo Using $T as temporary dir
......@@ -53,13 +58,13 @@ FI=$($CLUSTER head -n1 /var/lib/ganeti/ssconf_instance_list)
echo Testing hbal/luxi
./hbal -L$LUXI -p --print-instances -C$T/
./hbal -L$LUXI $GROUP -p --print-instances -C$T/
bash -n $T/
echo Testing hbal/rapi
./hbal -m$RAPI -p --print-instances -C$T/
./hbal -m$RAPI $GROUP -p --print-instances -C$T/
bash -n $T/
echo Testing hbal/text
./hbal -t$T/$ -p --print-instances -C$T/
./hbal -t$T/$ $GROUP -p --print-instances -C$T/
bash -n $T/
echo Comparing hbal results
diff -u $T/ $T/
......@@ -67,22 +72,22 @@ diff -u $T/ $T/
echo Testing hbal/text with evacuation mode
./hbal -t$T/$ -E
./hbal -t$T/$ $GROUP -E
echo Testing hbal/text with no disk moves
./hbal -t$T/$ --no-disk-moves
./hbal -t$T/$ $GROUP --no-disk-moves
echo Testing hbal/text with offline node mode
./hbal -t$T/$ -O$FN
./hbal -t$T/$ $GROUP -O$FN
echo Testing hbal/text with utilization data
echo "$FI 2 2 2 2" > $T/
./hbal -t$T/$ -U $T/
./hbal -t$T/$ $GROUP -U $T/
echo Testing hbal/text with bad utilization data
echo "$FI 2 a 3b" > $T/
! ./hbal -t$T/$ -U $T/
! ./hbal -t$T/$ $GROUP -U $T/
echo Testing hbal/text with instance exclusion
./hbal -t$T/$ --exclude-instances=$FI
./hbal -t$T/$ $GROUP --exclude-instances=$FI
! ./hbal -t$T/$ --exclude-instances=no_such_instance
echo Testing hbal/text with tag exclusion
./hbal -t $T/$ --exclusion-tags=no_such_tag
./hbal -t $T/$ $GROUP --exclusion-tags=no_such_tag
echo Testing hbal multiple backend failure
! ./hbal -t $T/$ -L$LUXI
echo Testing hbal no backend failure
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment