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 | 25b33d2a990a8c0c0f5d724fe4b9ea726dee9cf0 (patch) | |
| tree | eed71e8c20da6b3674ac441629fcb74f6c8703c4 /scripts/testing/maint-scenarios/32-cron-enable.sh | |
| parent | 261078d814c01479b8e4e2ece392ae06dcee7eee (diff) | |
| download | archsetup-25b33d2a990a8c0c0f5d724fe4b9ea726dee9cf0.tar.gz archsetup-25b33d2a990a8c0c0f5d724fe4b9ea726dee9cf0.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 'scripts/testing/maint-scenarios/32-cron-enable.sh')
| -rw-r--r-- | scripts/testing/maint-scenarios/32-cron-enable.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/testing/maint-scenarios/32-cron-enable.sh b/scripts/testing/maint-scenarios/32-cron-enable.sh new file mode 100644 index 0000000..39d4de6 --- /dev/null +++ b/scripts/testing/maint-scenarios/32-cron-enable.sh @@ -0,0 +1,20 @@ +# shellcheck shell=bash disable=SC2034 # sourced by run-maint-scenarios.sh +# Scenario: cronie enabled and started (the stopped-cron posture). +# +# Bootstrap installs cronie but never enables it — the broken state is the +# package's default. The remedy enables + starts the service. +SCENARIO_DESC="cronie enabled and started from the stopped state" +SCENARIO_GROUP="systemd" +SCENARIO_PROFILES="any" + +scenario_break() { + mexec "systemctl disable --now cronie.service >/dev/null 2>&1 || true; ! systemctl is-active cronie.service >/dev/null 2>&1" +} + +scenario_fix() { + mfix cron_enable +} + +scenario_assert() { + mexec "systemctl is-enabled cronie.service && systemctl is-active cronie.service" +} |
