File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / strongswan / testing / stop-testing
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Mar 17 00:20:09 2021 UTC (3 years, 3 months ago) by misho
Branches: strongswan, MAIN
CVS tags: v5_9_2p0, HEAD
strongswan 5.9.2

#!/bin/bash

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
TESTRESULTSTARGET=/var/run/kvm-swan-testresults

[ `id -u` -eq 0 ] || die "You must be root to run $0"

check_commands virsh

for net in $NETWORKS
do
	log_action "Network $net"
	execute "virsh net-destroy $net"
done

for host in $STRONGSWANHOSTS
do
	log_action "Guest $host"

	if running_any $host; then
		execute "virsh shutdown $host"
	else
		echo_warn "...not running"
	fi
	rm -f $VIRTIMGSTORE/$host.$IMGEXT
done

log_action "Removing kernel $KERNEL"
execute "rm $KNLTARGET"

log_action "Removing link to hostfs"
execute "rm $HOSTFSTARGET"

log_action "Removing link to testresults"
execute "rm $TESTRESULTSTARGET"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>