aboutsummaryrefslogtreecommitdiff
path: root/scripts/testing/debug-vm.sh
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-20 23:40:56 -0500
committerCraig Jennings <c@cjennings.net>2026-07-20 23:40:56 -0500
commit866d327f0bad3a0730801a22654bac45e02ee14b (patch)
tree4e73da36583178812fc7c36622ae3f6ec161606d /scripts/testing/debug-vm.sh
parentc076a79dddecf5680d738477402e50ee2ac09c0f (diff)
downloadarchsetup-866d327f0bad3a0730801a22654bac45e02ee14b.tar.gz
archsetup-866d327f0bad3a0730801a22654bac45e02ee14b.zip
fix(test): harden four VM-framework paths from the S5 audit
init_vm_paths suffixed the disk and NVRAM by FS_PROFILE but left PID_FILE, MONITOR_SOCK, and SERIAL_LOG shared. A concurrent btrfs and zfs run read each other's PID file, so the second run's stop logic could kill the first run's VM. All runtime paths now carry the suffix. kill_qemu sent kill -9 and returned without waiting, so the force-kill fallback could run qemu-img snapshot against a qcow2 the dying qemu still held locked (the restore failed silently behind || true, leaving the base image dirty). It now reaps or polls the process to death before returning. debug-vm.sh hardcoded the btrfs base-disk name, so FS_PROFILE=zfs booted the wrong base or fatalled. It now takes DISK_PATH from init_vm_paths. Both runners reported a completion-marker grep as "ArchSetup Exit Code," but the installer runs detached with set -e off, so its real exit status was never captured -- a run that errored mid-way and still reached its last line reported exit 0. The flag is now ARCHSETUP_COMPLETED with the report labeled honestly; Testinfra stays the pass/fail authority.
Diffstat (limited to 'scripts/testing/debug-vm.sh')
-rwxr-xr-xscripts/testing/debug-vm.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/testing/debug-vm.sh b/scripts/testing/debug-vm.sh
index b0fa2b9..d05ed59 100755
--- a/scripts/testing/debug-vm.sh
+++ b/scripts/testing/debug-vm.sh
@@ -46,7 +46,6 @@ fi
# Configuration
TIMESTAMP=$(date +'%Y%m%d-%H%M%S')
VM_IMAGES_DIR="$PROJECT_ROOT/vm-images"
-BASE_DISK="$VM_IMAGES_DIR/archsetup-base.qcow2"
ROOT_PASSWORD="archsetup"
OVERLAY_DISK=""
@@ -54,6 +53,9 @@ OVERLAY_DISK=""
LOGFILE="/tmp/debug-vm-$TIMESTAMP.log"
init_logging "$LOGFILE"
init_vm_paths "$VM_IMAGES_DIR"
+# The profile-correct base image comes from init_vm_paths; a hardcoded
+# archsetup-base.qcow2 booted the btrfs base under FS_PROFILE=zfs.
+BASE_DISK="$DISK_PATH"
cleanup_debug() {
if declare -f vm_is_running >/dev/null 2>&1 && vm_is_running; then