diff options
author | EuAndreh <eu@euandre.org> | 2023-03-22 11:46:58 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-03-22 11:46:58 -0300 |
commit | 33efef91edcac4976b880677fc0f5cf9fca67a59 (patch) | |
tree | 65bd7363ba895e2dd67060b95e4cef11c08502a5 /tests/vm-check.sh | |
parent | TODOs.md: Cleanup (diff) | |
download | package-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-x | tests/vm-check.sh | 11 |
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 |