feat(tools): commit the VM test harness + one-command installer regression

Promotes the throwaway harness that verified the installer into tools/:
- tools/vm/qmp.py        QMP keystroke injection / typing / quit
- tools/vm/vncshot.py    GL-safe screenshots via VNC readback (QMP
                         screendump shows "no surface" with virtio-vga-gl)
- tools/vm/gap-analysis.py  drv-graph diff that converged the offline
                         pin set; run it when offline installs build
                         from source
- tools/test-install.sh  the full offline regression: build ISO, boot
                         offline, unattended LUKS+swap install via a
                         config disk (typed long commands drop keys),
                         wait for poweroff, boot the installed disk,
                         screenshot the first boot for visual verdict

docs/TESTING.md §4 now points at the script.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-06-12 08:05:13 +01:00
parent 7b5a22c800
commit a50e9793ea
6 changed files with 457 additions and 16 deletions

View File

@@ -69,25 +69,29 @@ model end to end.
## 4. Testing the installer
The installer has an unattended mode for exactly this. Boot the live ISO in
QEMU **with a second, blank disk attached** (e.g. `-drive
file=target.img,if=virtio,format=raw` on a 20 G image), then in the live
terminal:
One command runs the whole offline regression:
```sh
sudo NOMARCHY_UNATTENDED=1 NOMARCHY_DISK=/dev/vda \
NOMARCHY_USERNAME=me NOMARCHY_PASSWORD=test \
NOMARCHY_LUKS_PASSPHRASE=testtest1 \
NOMARCHY_FINISH=poweroff nomarchy-install
tools/test-install.sh
```
Then boot the VM again **from the target disk** (drop `-cdrom`). After
typing the LUKS passphrase at the initrd prompt, the machine must reach
the themed desktop **without a login prompt** (LUKS implies auto-login)
wallpaper, Waybar — and `nomarchy-theme-sync apply <x>` must work. For the
offline claim, add `restrict=on` to the `-netdev` and re-run the whole
flow: it must behave identically (requires an ISO built from a clean git
tree, which is what bakes the rev into the installer).
It builds the ISO, boots it in QEMU **with networking disabled**, runs an
unattended LUKS+swap install onto a blank disk via the installer's
`NOMARCHY_UNATTENDED=1` mode (config delivered on a small vfat disk
typing long commands into a guest drops keystrokes), waits for the
installer's poweroff, then boots the installed disk, enters the
passphrase, and screenshots the first boot. The machine-checkable parts
(install completes, disk boots) fail the script; the visual verdict —
**themed desktop, no autogenerated-config banner, no login prompt** — is
yours, from `first-boot.png`. The helpers it builds on live in
`tools/vm/` (QMP key injection, GL-safe VNC screenshots) and work for any
manual VM poking; `tools/vm/gap-analysis.py` is the maintainer tool for
diagnosing offline installs that try to build from source.
To test by hand instead, replicate what `tools/test-install.sh` does: the
unattended env it uses is in the script, and the same flow works
interactively from the live terminal. If the desktop comes up unthemed,
read `/var/log/nomarchy-hm-preactivate.log` on the installed system.
## 5. VM-specific gotchas