Clean up IKE_SA state if IKE_SA_INIT request does not have message ID 0
[strongswan.git] / testing / stop-testing
index 852e2ec..704ae66 100755 (executable)
@@ -1,11 +1,14 @@
 #!/bin/bash
 
-. $PWD/scripts/function.sh
+DIR=$(dirname `readlink -f $0`)
+. $DIR/testing.conf
+. $DIR/scripts/function.sh
 
 echo "Stopping test environment"
 
 NETWORKS="vnet1 vnet2 vnet3"
 KNLTARGET=/var/run/kvm-swan-kernel
+HOSTFSTARGET=/var/run/kvm-swan-hostfs
 
 [ `id -u` -eq 0 ] || die "You must be root to run $0"
 
@@ -20,9 +23,12 @@ done
 for host in $STRONGSWANHOSTS
 do
        log_action "Guest $host"
-       execute "virsh destroy $host"
+       execute "virsh shutdown $host"
        rm -f $VIRTIMGSTORE/$host.$IMGEXT
 done
 
 log_action "Removing kernel $KERNEL"
 execute "rm $KNLTARGET"
+
+log_action "Removing link to hostfs"
+execute "rm $HOSTFSTARGET"