aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-03-29 08:32:12 -0300
committerEuAndreh <eu@euandre.org>2023-03-29 09:03:33 -0300
commit3abb39ef09cd872c5b209b28bd46732aaf896535 (patch)
tree6d030f30d9c97cbc8baa1b6cc9e47e4153a17a8f /tests
parentUse abuild(1) to build ".apk" packages (diff)
downloadpackage-repository-3abb39ef09cd872c5b209b28bd46732aaf896535.tar.gz
package-repository-3abb39ef09cd872c5b209b28bd46732aaf896535.tar.xz
tests/vm-check.sh: Timestamp each output via ts(1)
Diffstat (limited to 'tests')
-rwxr-xr-xtests/vm-check.sh34
1 files changed, 19 insertions, 15 deletions
diff --git a/tests/vm-check.sh b/tests/vm-check.sh
index 327aa6d..e6b4af4 100755
--- a/tests/vm-check.sh
+++ b/tests/vm-check.sh
@@ -77,11 +77,11 @@ eval "$(assert-arg -- "${REMOTE:-}" '-r REMOTE')"
SEP="$(color -c blacki ':')"
pre_guest() {
- sed "s|^|$(color -c green "$HOST")$SEP$(color -c yellow "$TYPE")$SEP |"
+ sed -u "s|^|$(color -c green "$HOST")$SEP$(color -c yellow "$TYPE")$SEP |"
}
pre_host() {
- sed "s|^|$(color -c blueb "$0")$SEP |"
+ sed -u "s|^|$(color -c blueb "$0")$SEP |"
}
STATUS_F="$(mkstemp)"
@@ -96,17 +96,21 @@ shutdown() {
trap shutdown EXIT
{
- 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
-{
- STATUS=0
- # shellcheck disable=2029
- ssh "$HOST" sh check.sh "$@" "$REMOTE" || STATUS=$?
- printf '%s' "$STATUS" > "$STATUS_F"
-} 2>&1 | pre_guest
+ {
+ 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
+
+ {
+ STATUS=0
+ # shellcheck disable=2029
+ ssh "$HOST" sh check.sh "$@" "$REMOTE" || STATUS=$?
+ printf '%s' "$STATUS" > "$STATUS_F"
+ } 2>&1 | pre_guest
+
+} | ts -s '%.s'