3 DIR=$(dirname `readlink -f $0`)
5 . $DIR/scripts/function.sh
7 echo "Stopping test environment"
9 NETWORKS="vnet1 vnet2 vnet3"
10 KNLTARGET=/var/run/kvm-swan-kernel
11 HOSTFSTARGET=/var/run/kvm-swan-hostfs
12 TESTRESULTSTARGET=/var/run/kvm-swan-testresults
14 [ `id -u` -eq 0 ] || die "You must be root to run $0"
20 log_action "Network $net"
21 execute "virsh net-destroy $net"
24 for host in $STRONGSWANHOSTS
26 log_action "Guest $host"
28 if running_any $host; then
29 execute "virsh shutdown $host"
31 echo_warn "...not running"
33 rm -f $VIRTIMGSTORE/$host.$IMGEXT
36 log_action "Removing kernel $KERNEL"
37 execute "rm $KNLTARGET"
39 log_action "Removing link to hostfs"
40 execute "rm $HOSTFSTARGET"
42 log_action "Removing link to testresults"
43 execute "rm $TESTRESULTSTARGET"