Files
pxe-server/tests/vm/destroy.sh
cproudlock 576955785d Faster shopfloor-setup sync, prompt spacing, XP-era test client
- Deploy shopfloor-setup with rsync instead of the copy module: the
  ~4 GB tree took about 4 minutes on every re-run because copy checksums
  each file. rsync transfers only changes; changed only when it did.
- iPXE drops a trailing space, so 'Machine number:' ran into the typed
  digits. The space now comes from a hex 20 setting.
- tests/vm: pxetest-xp is a permanent client (SeaBIOS, qemu32 32-bit CPU,
  rtl8139, 1 GiB, IDE disk) for the i686 Clonezilla path; start.sh xp.
  Only one client may run at a time across all three.
2026-10-15 21:43:33 -04:00

24 lines
912 B
Bash
Executable File

#!/bin/bash
# Remove every pxetest-* object: both domains (and their nvram), the
# volumes, and the isolated network. Idempotent. Does not touch the
# cached ISO / USB image file (delete $PXETEST_CACHE by hand).
# Usage: tests/vm/destroy.sh
source "$(dirname "$0")/common.sh"
for vm in "${ALL_CLIENTS[@]}" "$SERVER_VM"; do
dom_exists "$vm" || continue
[ "$(dom_state "$vm")" = "shut off" ] || virsh destroy "$vm" >/dev/null
virsh undefine "$vm" --nvram >/dev/null
log "undefined $vm"
done
for v in "$SERVER_DISK_VOL" "$USB_VOL" "$CLIENT_DISK_VOL" "$CLIENT2_DISK_VOL" "$CLIENT3_DISK_VOL"; do
vol_exists "$v" || continue
virsh vol-delete --pool "$POOL" "$v" >/dev/null
log "deleted volume $v"
done
if net_exists "$IMAGING_NET"; then
virsh net-destroy "$IMAGING_NET" >/dev/null 2>&1 || true
virsh net-undefine "$IMAGING_NET" >/dev/null
log "removed network $IMAGING_NET"
fi