2006-04-28 07:14:48 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2012-12-18 15:44:21 +00:00
|
|
|
DIR=$(dirname `readlink -f $0`)
|
|
|
|
. $DIR/testing.conf
|
|
|
|
. $DIR/scripts/function.sh
|
2006-04-28 07:14:48 +00:00
|
|
|
|
2012-12-07 10:48:48 +00:00
|
|
|
echo "Stopping test environment"
|
2006-04-28 07:14:48 +00:00
|
|
|
|
2012-12-07 10:48:48 +00:00
|
|
|
NETWORKS="vnet1 vnet2 vnet3"
|
|
|
|
KNLTARGET=/var/run/kvm-swan-kernel
|
2012-12-17 18:00:31 +00:00
|
|
|
HOSTFSTARGET=/var/run/kvm-swan-hostfs
|
2006-04-28 07:14:48 +00:00
|
|
|
|
2012-12-07 10:48:48 +00:00
|
|
|
[ `id -u` -eq 0 ] || die "You must be root to run $0"
|
2006-04-28 07:14:48 +00:00
|
|
|
|
2012-12-13 09:31:44 +00:00
|
|
|
check_commands virsh
|
|
|
|
|
2012-12-07 10:48:48 +00:00
|
|
|
for net in $NETWORKS
|
|
|
|
do
|
|
|
|
log_action "Network $net"
|
|
|
|
execute "virsh net-destroy $net"
|
|
|
|
done
|
2006-04-28 07:14:48 +00:00
|
|
|
|
2012-12-07 10:48:48 +00:00
|
|
|
for host in $STRONGSWANHOSTS
|
2006-04-28 07:14:48 +00:00
|
|
|
do
|
2012-12-07 10:48:48 +00:00
|
|
|
log_action "Guest $host"
|
2013-01-16 10:54:28 +00:00
|
|
|
execute "virsh shutdown $host"
|
2012-12-10 09:05:02 +00:00
|
|
|
rm -f $VIRTIMGSTORE/$host.$IMGEXT
|
2006-04-28 07:14:48 +00:00
|
|
|
done
|
|
|
|
|
2012-12-07 10:48:48 +00:00
|
|
|
log_action "Removing kernel $KERNEL"
|
|
|
|
execute "rm $KNLTARGET"
|
2012-12-17 18:00:31 +00:00
|
|
|
|
|
|
|
log_action "Removing link to hostfs"
|
|
|
|
execute "rm $HOSTFSTARGET"
|