aboutsummaryrefslogtreecommitdiff
path: root/tests/vm-check.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xtests/vm-check.sh25
1 files changed, 17 insertions, 8 deletions
diff --git a/tests/vm-check.sh b/tests/vm-check.sh
index ddae0e2..9390acb 100755
--- a/tests/vm-check.sh
+++ b/tests/vm-check.sh
@@ -75,19 +75,28 @@ eval "$(assert-arg -- "${HOST:-}" '-H HOST')"
eval "$(assert-arg -- "${REMOTE:-}" '-r REMOTE')"
+SEP="$(color -c blacki ':')"
+pre_guest() {
+ sed "s|^|$(color -c green "$HOST")$SEP$(color -c yellow "$TYPE")$SEP |"
+}
-if [ "$SHUTDOWN" = true ]; then
- vm down "$HOST"
-fi
+pre_host() {
+ sed "s|^|$(color -c blueb "$0")$SEP |"
+}
shutdown() {
if [ "$SHUTDOWN" = true ]; then
- vm down "$HOST"
+ vm down "$HOST" 2>&1 | pre_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
+ vm up "$HOST"
+ untill -m5 -n5 ssh "$HOST" uptime
+ scp tests/checks/"$TYPE".sh "$HOST":check.sh
+} 2>&1 | pre_host
+ssh "$HOST" sh check.sh "$REMOTE" 2>&1 | pre_guest