Install QEMU's virtio-vga display and check for it

The smoketest VMs start with -vga virtio, but Arch packages that display
apart from qemu-base, so the base image build failed with "Virtio VGA not
available". update.sh now installs qemu-hw-display-virtio-vga, and doctor
and smoketest run check QEMU has the display before anything downloads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-04 20:04:39 -07:00
co-authored by Claude Opus 5.5
parent b41b70619d
commit 2207208326
8 changed files with 45 additions and 5 deletions
+12
View File
@@ -71,3 +71,15 @@ load test_helper
[[ "$output" == *"Usage: coredesktop-dev doctor"* ]]
not_called flatpak-spawn
}
@test "doctor reports QEMU without the virtio-vga display" {
make_working_copy
stub qemu-system-x86_64 'echo "name \"VGA\", bus PCI"'
run cdd doctor
[ "$status" -eq 1 ]
[[ "$output" == *"PROBLEM QEMU has no virtio-vga display"* ]]
stub qemu-system-x86_64 'echo "name \"virtio-vga\", bus PCI"'
run cdd doctor
[[ "$output" == *"ok QEMU has the virtio-vga display"* ]]
}
+1 -1
View File
@@ -14,7 +14,7 @@ config() {
[[ "$output" == *"is the deployed copy"* ]]
[ "$(config)" = "WORKING_COPY=$(printf '%q' "$WC")" ]
[ "$(readlink "$HOME/.local/bin/coredesktop-dev")" = "$PROJECT/bin/coredesktop-dev" ]
called install_packages shellcheck bats tea qemu-base libisoburn
called install_packages shellcheck bats tea qemu-base qemu-hw-display-virtio-vga libisoburn
}
@test "install refuses the deployed copy however it's spelled" {
+13 -3
View File
@@ -18,7 +18,8 @@ setup() {
git -C "$WC" rev-parse HEAD > "$STATE/images/installed.ref"
# A VM is a sleep that lets go of bats' output pipes
stub qemu-system-x86_64 'while [ $# -gt 0 ]; do [ "$1" = -pidfile ] && pidfile="$2"; shift; done
stub qemu-system-x86_64 '[ "$*" = "-device help" ] && { echo "name \"virtio-vga\", bus PCI"; exit; }
while [ $# -gt 0 ]; do [ "$1" = -pidfile ] && pidfile="$2"; shift; done
/usr/bin/sleep 300 > /dev/null 2>&1 3>&- &
echo $! > "$pidfile"'
stub qemu-img 'touch "${@: -1}"'
@@ -98,7 +99,16 @@ last_run() {
run cdd smoketest run 10 nosuch
[ "$status" -eq 1 ]
[[ "$output" == *"No scenario called nosuch"* ]]
not_called qemu-system-x86_64
# Only the check for the virtio-vga display, no VM
[ -z "$(grep '^qemu-system-x86_64 ' "$STUB_LOG" | grep -v -- '-device help')" ]
}
@test "run stops before any VM when QEMU has no virtio-vga display" {
stub qemu-system-x86_64 'echo "name \"VGA\", bus PCI"'
run cdd smoketest run 10
[ "$status" -eq 1 ]
[[ "$output" == *"QEMU has no virtio-vga display"* ]]
[ "$(grep -c '^qemu-system-x86_64 ' "$STUB_LOG")" -eq 1 ]
}
@test "each variant runs in its own VM" {
@@ -106,7 +116,7 @@ last_run() {
[ "$status" -eq 0 ]
[[ "$output" == *"PASS 30-variants @ one"* ]]
[[ "$output" == *"PASS 30-variants @ two"* ]]
[ "$(grep -c '^qemu-system-x86_64 ' "$STUB_LOG")" -eq 2 ]
[ "$(grep '^qemu-system-x86_64 ' "$STUB_LOG" | grep -vc -- '-device help')" -eq 2 ]
grep -q "variant two" "$(last_run)/30-variants@two/scenario.log"
}
+1 -1
View File
@@ -7,7 +7,7 @@ HOOK_MARKER="# Installed by coredesktop-dev; remove with: coredesktop-dev hooks
@test "update installs the packages and links the command, without asking anything" {
run bash "$PROJECT/update.sh" < /dev/null
[ "$status" -eq 0 ]
called install_packages shellcheck bats tea qemu-base libisoburn
called install_packages shellcheck bats tea qemu-base qemu-hw-display-virtio-vga libisoburn
[ "$(readlink "$HOME/.local/bin/coredesktop-dev")" = "$PROJECT/bin/coredesktop-dev" ]
}