diff options
| author | Craig Jennings <c@cjennings.net> | 2026-07-08 05:45:51 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-07-08 05:45:51 -0500 |
| commit | d6993d35368f4733cac7dfd23be354de7ef0a0fb (patch) | |
| tree | 5b4fb22b66d69bf5851dac0e32614ef958af5378 /Makefile | |
| parent | 26f7ea43ed3ef2dcb088dc4af5eb5881743f6a88 (diff) | |
| download | archsetup-d6993d35368f4733cac7dfd23be354de7ef0a0fb.tar.gz archsetup-d6993d35368f4733cac7dfd23be354de7ef0a0fb.zip | |
test(maint): add VM and nspawn remedy scenario harness
Nine break/fix/assert scenarios run the real maint fix inside the test VM. The runner batches non-conflicting scenarios into one VM boot, restores the snapshot only between groups, and leaves the base image pristine afterwards. A systemd-nspawn fast lane runs the pacman-level group against a cached pacstrap rootfs in seconds. The plan layer validates the scenario contract without a VM and carries a 19-test unit suite. make test-maint wires the VM lane in.
The zfs lane is filtered but unexercised: the FS_PROFILE=zfs base image fails to build (ZFS DKMS module not found on linux-lts 6.18). The failure is tracked in the todo.
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -5,7 +5,7 @@ # (https://git.cjennings.net/dotfiles.git). Run them from there: # cd ~/.dotfiles && make stow|restow|reset|unstow|import <de> -.PHONY: help deps test-unit test test-keep test-vm-base package-diff +.PHONY: help deps test-unit test test-keep test-vm-base test-maint package-diff # Filesystem profile for the VM harness: btrfs (default) or zfs. Selects the # base image the scripts build/use; exported so create-base-vm.sh + run-test.sh @@ -28,6 +28,7 @@ help: @echo " test Run full VM test suite (creates base VM if needed)" @echo " test-keep Run test and keep VM running for manual testing" @echo " test-vm-base Create base VM only (runs archangel)" + @echo " test-maint Run maint remedy scenarios in the VM (break/fix/assert)" @echo " package-diff Compare archsetup's declared packages vs this system" @echo "" @echo "Filesystem profile (test, test-keep, test-vm-base):" @@ -81,6 +82,18 @@ test-keep: fi @bash scripts/testing/run-test.sh --keep +# Maintenance-console remedy scenarios: break the VM, run the real +# `maint fix`, assert the post-state. Grouped batches over the clean-install +# snapshot; the base image is restored afterwards. `--list` variant to +# preview: bash scripts/testing/run-maint-scenarios.sh --list +test-maint: + @if [ ! -f $(BASE_IMAGE) ] || \ + ! qemu-img snapshot -l $(BASE_IMAGE) 2>/dev/null | grep -q "clean-install"; then \ + echo "Base VM not found or missing snapshot, creating ($(FS_PROFILE))..."; \ + bash scripts/testing/create-base-vm.sh; \ + fi + @bash scripts/testing/run-maint-scenarios.sh + # Compare the packages archsetup declares against what's installed here. # Shows declared-but-missing and installed-but-undeclared (AUR vs official). package-diff: |
