Export compile directory to guests
[strongswan.git] / testing / stop-testing
1 #!/bin/bash
2
3 . $PWD/scripts/function.sh
4
5 echo "Stopping test environment"
6
7 NETWORKS="vnet1 vnet2 vnet3"
8 KNLTARGET=/var/run/kvm-swan-kernel
9 HOSTFSTARGET=/var/run/kvm-swan-hostfs
10
11 [ `id -u` -eq 0 ] || die "You must be root to run $0"
12
13 check_commands virsh
14
15 for net in $NETWORKS
16 do
17         log_action "Network $net"
18         execute "virsh net-destroy $net"
19 done
20
21 for host in $STRONGSWANHOSTS
22 do
23         log_action "Guest $host"
24         execute "virsh destroy $host"
25         rm -f $VIRTIMGSTORE/$host.$IMGEXT
26 done
27
28 log_action "Removing kernel $KERNEL"
29 execute "rm $KNLTARGET"
30
31 log_action "Removing link to hostfs"
32 execute "rm $HOSTFSTARGET"