From 3d7380572f1f4cfb6dd19baad459f352ec3e5db5 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 22 Mar 2023 15:00:17 -0300 Subject: tests/vm-check.sh: Add markers of what is running where --- tests/vm-check.sh | 25 +++++++++++++++++-------- 1 file 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 -- cgit v1.2.3