aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-03-24 17:20:16 -0300
committerEuAndreh <eu@euandre.org>2023-03-24 17:20:16 -0300
commitf33e7df9fc896ad01bf7395cc4da119703b5208a (patch)
tree1f05281149dc89e6f8bc2f8994b4866c47c95ee2 /tests
parentMakefile: Add "check-shellcheck" target (diff)
downloadpackage-repository-f33e7df9fc896ad01bf7395cc4da119703b5208a.tar.gz
package-repository-f33e7df9fc896ad01bf7395cc4da119703b5208a.tar.xz
tests/vm-check.sh: Fail when "check.sh" fails
Diffstat (limited to 'tests')
-rwxr-xr-xtests/vm-check.sh12
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