blob: f0357f09100f382c58f8df9e711a40d12554a422 (
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
33
34
35
36
37
38
39
40
41
42
43
44
|
# The URI is the whole of what viewer decides, and VIEWER=echo reports
# it without a client anywhere. The guests here are emulated.
"$VMM" create vw1 64M >/dev/null 2>&1
exits 2 "viewer of an unknown VM exits 2" viewer nosuchvm
exits 3 "viewer of a stopped VM exits 3" viewer vw1
cfg vw1 <<EOF
MEM=256
CPUS=1
HWACCEL=no
EOF
if "$VMM" start vw1 >/dev/null 2>&1; then
refuses 'has no display' "GRAPHICS=no leaves nothing to view" viewer vw1
"$VMM" kill vw1 >/dev/null 2>&1 || :
else
skip 1 "vw1 did not start"
fi
# The URI names the socket that is really there, not what the config
# says, so a display that failed to appear is an error rather than a
# client left dialling nothing.
for g in vnc spice; do
cfg vw1 <<EOF
MEM=256
CPUS=1
HWACCEL=no
GRAPHICS=$g
EOF
if ! "$VMM" start vw1 >/dev/null 2>&1; then
skip 2 "this qemu cannot do GRAPHICS=$g"
continue
fi
out=$(env VIEWER=echo "$VMM" viewer vw1 2>&1) && got=0 || got=$?
if [ "$got" = 0 ] && [ "$out" = "$g+unix://$VMMDIR/vw1/$g.sock" ]; then
ok "$g is handed to the client as $g+unix"
else
notok "$g is handed to the client as $g+unix" \
"exit $got, wanted $g+unix://$VMMDIR/vw1/$g.sock" "got: $out"
fi
"$VMM" kill vw1 >/dev/null 2>&1 || :
exits 3 "and the killed $g guest has nothing to view" viewer vw1
done
|