blob: aa0ea9b3489d16a7697dd62511e8fafab53b9ce6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# Environment variables reach qemu and the timeout loops, so they are
# checked once for every verb rather than inside the one that uses them.
"$VMM" create ev1 64M >/dev/null 2>&1
# A differently spelled VMMDIR must name the same VMs, or a live guest
# goes invisible and the next verb deletes its disk.
a=$("$VMM" list -q | sort | tr '\n' ' ')
b=$(VMMDIR="$VMMDIR/" "$VMM" list -q | sort | tr '\n' ' ')
if [ "$a" = "$b" ]; then
ok "a trailing slash on VMMDIR names the same VMs"
else
notok "a trailing slash on VMMDIR names the same VMs" "[$a] vs [$b]"
fi
out=$(VMMDIR=relative/path "$VMM" list 2>&1) && got=0 || got=$?
if [ "$got" != 0 ] && printf '%s' "$out" | grep -q 'absolute path'; then
ok "a relative VMMDIR is refused"
else
notok "a relative VMMDIR is refused" "exit $got: $out"
fi
for v in SHUTDOWN_TIMEOUT MONITOR_TIMEOUT; do
for bad in abc 0 00 99999999999999999999; do
out=$(env "$v=$bad" "$VMM" list 2>&1) && got=0 || got=$?
if [ "$got" = 1 ] && printf '%s' "$out" | grep -q "$v must be"; then
ok "$v refuses $bad"
else
notok "$v refuses $bad" "exit $got: $out"
fi
done
done
|