aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xtests/vm-check.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/vm-check.sh b/tests/vm-check.sh
index 5b50ec7..ddae0e2 100755
--- a/tests/vm-check.sh
+++ b/tests/vm-check.sh
@@ -80,11 +80,14 @@ if [ "$SHUTDOWN" = true ]; then
vm down "$HOST"
fi
+shutdown() {
+ if [ "$SHUTDOWN" = true ]; then
+ vm down "$HOST"
+ fi
+}
+trap shutdown EXIT
+
vm up "$HOST"
untill -m5 -n5 ssh "$HOST" uptime
scp tests/checks/"$TYPE".sh "$HOST":check.sh
ssh "$HOST" sh check.sh "$REMOTE"
-
-if [ "$SHUTDOWN" = true ]; then
- vm down "$HOST"
-fi