]>
Commit | Line | Data |
---|---|---|
997358a6 | 1 | #!/bin/bash |
997358a6 | 2 | |
aafc0a17 RB |
3 | DIR=$(dirname `readlink -f $0`) |
4 | . $DIR/testing.conf | |
5 | . $DIR/scripts/function.sh | |
997358a6 | 6 | |
9b3316ed | 7 | echo "Stopping test environment" |
997358a6 | 8 | |
9b3316ed RB |
9 | NETWORKS="vnet1 vnet2 vnet3" |
10 | KNLTARGET=/var/run/kvm-swan-kernel | |
0593b6c9 | 11 | HOSTFSTARGET=/var/run/kvm-swan-hostfs |
7a8985b5 | 12 | TESTRESULTSTARGET=/var/run/kvm-swan-testresults |
997358a6 | 13 | |
9b3316ed | 14 | [ `id -u` -eq 0 ] || die "You must be root to run $0" |
997358a6 | 15 | |
82499010 RB |
16 | check_commands virsh |
17 | ||
9b3316ed RB |
18 | for net in $NETWORKS |
19 | do | |
20 | log_action "Network $net" | |
21 | execute "virsh net-destroy $net" | |
22 | done | |
997358a6 | 23 | |
9b3316ed | 24 | for host in $STRONGSWANHOSTS |
997358a6 | 25 | do |
9b3316ed | 26 | log_action "Guest $host" |
677795c3 | 27 | execute "virsh shutdown $host" |
258cbd40 | 28 | rm -f $VIRTIMGSTORE/$host.$IMGEXT |
997358a6 | 29 | done |
997358a6 | 30 | |
9b3316ed RB |
31 | log_action "Removing kernel $KERNEL" |
32 | execute "rm $KNLTARGET" | |
0593b6c9 RB |
33 | |
34 | log_action "Removing link to hostfs" | |
35 | execute "rm $HOSTFSTARGET" | |
7a8985b5 TB |
36 | |
37 | log_action "Removing link to testresults" | |
38 | execute "rm $TESTRESULTSTARGET" |