Initial commit: Sparrowdo Testing Orchestrator framework
- Add VM provisioning, cleanup, and setup scripts - Add Jenkins pipeline with parameterized builds - Add comprehensive documentation - Support for parallel test execution with QCOW2 linked clones
This commit is contained in:
25
scripts/cleanup_vm.sh
Executable file
25
scripts/cleanup_vm.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
VM_NAME="$1"
|
||||
|
||||
if [ -z "$VM_NAME" ]; then
|
||||
echo "Usage: $0 <vm_name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[Cleanup] Starting cleanup for VM: $VM_NAME"
|
||||
|
||||
# Force stop VM
|
||||
echo "[Cleanup] Destroying VM..."
|
||||
sudo virsh destroy "$VM_NAME" 2>/dev/null || echo "[Cleanup] VM was not running"
|
||||
|
||||
# Remove VM definition
|
||||
echo "[Cleanup] Undefining VM..."
|
||||
sudo virsh undefine "$VM_NAME" 2>/dev/null || echo "[Cleanup] VM definition already removed"
|
||||
|
||||
# Remove disk image
|
||||
echo "[Cleanup] Removing disk image..."
|
||||
sudo rm -f "/var/lib/libvirt/images/${VM_NAME}.qcow2" || echo "[Cleanup] Disk already removed"
|
||||
|
||||
echo "[Cleanup] Complete for $VM_NAME"
|
||||
Reference in New Issue
Block a user