diff options
Diffstat (limited to '')
-rwxr-xr-x | tests/vm-check.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/vm-check.sh b/tests/vm-check.sh index de78f0c..78086e7 100755 --- a/tests/vm-check.sh +++ b/tests/vm-check.sh @@ -84,10 +84,14 @@ pre_host() { sed "s|^|$(color -c blueb "$0")$SEP |" } +STATUS_F="$(mkstemp)" shutdown() { + STATUS="$(cat "$STATUS_F" || echo 1)" + rm -f "$STATUS_F" if [ "$SHUTDOWN" = true ]; then vm down "$HOST" 2>&1 | pre_host fi + exit "$STATUS" } trap shutdown EXIT @@ -100,5 +104,9 @@ trap shutdown EXIT scp tests/checks/"$TYPE".sh "$HOST":check.sh } 2>&1 | pre_host -# shellcheck disable=2029 -ssh "$HOST" sh check.sh "$REMOTE" 2>&1 | pre_guest +{ + STATUS=0 + # shellcheck disable=2029 + ssh "$HOST" sh check.sh "$REMOTE" || STATUS=$? + printf '%s' "$STATUS" > "$STATUS_F" +} 2>&1 | pre_guest |