]>
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" |
8f2b6d70 TB |
27 | |
28 | if running_any $host; then | |
29 | execute "virsh shutdown $host" | |
30 | else | |
31 | echo_warn "...not running" | |
32 | fi | |
258cbd40 | 33 | rm -f $VIRTIMGSTORE/$host.$IMGEXT |
997358a6 | 34 | done |
997358a6 | 35 | |
9b3316ed RB |
36 | log_action "Removing kernel $KERNEL" |
37 | execute "rm $KNLTARGET" | |
0593b6c9 RB |
38 | |
39 | log_action "Removing link to hostfs" | |
40 | execute "rm $HOSTFSTARGET" | |
7a8985b5 TB |
41 | |
42 | log_action "Removing link to testresults" | |
43 | execute "rm $TESTRESULTSTARGET" |