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