Annotation of embedaddon/strongswan/testing/stop-testing, revision 1.1.1.2

1.1       misho       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: TESTRESULTSTARGET=/var/run/kvm-swan-testresults
                     13: 
                     14: [ `id -u` -eq 0 ] || die "You must be root to run $0"
                     15: 
                     16: check_commands virsh
                     17: 
                     18: for net in $NETWORKS
                     19: do
                     20:        log_action "Network $net"
                     21:        execute "virsh net-destroy $net"
                     22: done
                     23: 
                     24: for host in $STRONGSWANHOSTS
                     25: do
                     26:        log_action "Guest $host"
1.1.1.2 ! misho      27: 
        !            28:        if running_any $host; then
        !            29:                execute "virsh shutdown $host"
        !            30:        else
        !            31:                echo_warn "...not running"
        !            32:        fi
1.1       misho      33:        rm -f $VIRTIMGSTORE/$host.$IMGEXT
                     34: done
                     35: 
                     36: log_action "Removing kernel $KERNEL"
                     37: execute "rm $KNLTARGET"
                     38: 
                     39: log_action "Removing link to hostfs"
                     40: execute "rm $HOSTFSTARGET"
                     41: 
                     42: log_action "Removing link to testresults"
                     43: execute "rm $TESTRESULTSTARGET"

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