Commit 8d616d4d authored by Iustin Pop's avatar Iustin Pop
Browse files

Add utilisation and instance selection tests


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 30084381
......@@ -130,6 +130,28 @@ for suffix in standard tiered; do
done
echo OK
echo Checking utilisation-based code
BACKEND="-t $T/simu-onegroup.standard"
echo a > $T/dynu
(! hbal -U <(echo a) $BACKEND 2>&1 ) | grep -q "Cannot parse line"
(! hbal -U <(echo a b c d e f g h) $BACKEND 2>&1 ) | \
grep -q "Cannot parse line"
(! hbal -U <(echo inst cpu mem dsk net) $BACKEND 2>&1 ) | \
grep -Eq "cannot parse string '(cpu|mem|dsk|net)'"
# unknown instances are currently just ignored
hbal -U <(echo no-such-inst 2 2 2 2) $BACKEND >/dev/null 2>&1
# new-0 is the name of the first instance allocated by hspace
hbal -U <(echo new-0 2 2 2 2) $BACKEND >/dev/null 2>&1
echo OK
echo Checking selected/excluded instances
(! hbal $BACKEND --exclude-instances no-such-instance 2>&1 ) | \
grep -q "Unknown instance"
(! hbal $BACKEND --select-instances no-such-instances 2>&1 ) | \
grep -q "Unknown instance"
hbal $BACKEND --exclude-instances new-0 --select-instances new-1 >/dev/null
echo OK
echo IAllocator checks
# test that on invalid files it can't parse the request
(! hail /dev/null 2>&1 ) | grep -q "Invalid JSON"
......
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