feat: delete ISO when destroying test VM

When running './run.sh test:iso destroy', also delete the ISO file
and its checksums. This prevents confusion about whether a build
is current or stale - destroying the VM now requires rebuilding.

Reference: User request

💘 Generated with Crush

Assisted-by: GLM-5 via Crush <crush@charm.land>
This commit is contained in:
Charles N Wyble
2026-02-20 12:21:00 -05:00
parent 9b3e282d20
commit f82fe920d6

7
run.sh
View File

@@ -323,6 +323,13 @@ vm_destroy() {
virsh -c "$LIBVIRT_URI" destroy "$VM_NAME" 2>/dev/null || true
virsh -c "$LIBVIRT_URI" undefine "$VM_NAME" --nvram 2>/dev/null || true
rm -f "$VM_DISK_PATH" "$VM_ISO_PATH" "/tmp/${VM_NAME}.xml" "/tmp/${VM_NAME}_VARS.fd"
# Also delete ISO to avoid confusion over build status
if [[ -f "$ISO_PATH" ]]; then
log_info "Removing ISO: $ISO_PATH"
rm -f "$ISO_PATH" "${ISO_PATH}.md5" "${ISO_PATH}.sha256"
fi
log_info "Cleanup complete"
}