aboutsummaryrefslogtreecommitdiff
path: root/tests/vm-check.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-03-22 11:46:58 -0300
committerEuAndreh <eu@euandre.org>2023-03-22 11:46:58 -0300
commit33efef91edcac4976b880677fc0f5cf9fca67a59 (patch)
tree65bd7363ba895e2dd67060b95e4cef11c08502a5 /tests/vm-check.sh
parentTODOs.md: Cleanup (diff)
downloadpackage-repository-33efef91edcac4976b880677fc0f5cf9fca67a59.tar.gz
package-repository-33efef91edcac4976b880677fc0f5cf9fca67a59.tar.xz
tests/vm-check.sh: Still shutdown if "check.sh" fails when -x is given
Diffstat (limited to 'tests/vm-check.sh')
-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