|
|
8d419f |
From 1e684870a7f893fcd9138c0ca6bde0fcf3bf752a Mon Sep 17 00:00:00 2001
|
|
|
8d419f |
From: Frantisek Sumsal <frantisek@sumsal.cz>
|
|
|
8d419f |
Date: Fri, 17 Jun 2022 14:44:49 +0200
|
|
|
8d419f |
Subject: [PATCH] test: make the busy loop in TEST-02 less verbose
|
|
|
8d419f |
|
|
|
8d419f |
as it unnecessarily clogs the logs.
|
|
|
8d419f |
|
|
|
8d419f |
(cherry picked from commit 582547cbd38a02289451c1cea36a32f446b66677)
|
|
|
8d419f |
|
|
|
8d419f |
Related: #2087652
|
|
|
8d419f |
---
|
|
|
8d419f |
test/units/testsuite-02.sh | 5 +++++
|
|
|
8d419f |
1 file changed, 5 insertions(+)
|
|
|
8d419f |
|
|
|
8d419f |
diff --git a/test/units/testsuite-02.sh b/test/units/testsuite-02.sh
|
|
|
8d419f |
index af6e007825..54927a6377 100755
|
|
|
8d419f |
--- a/test/units/testsuite-02.sh
|
|
|
8d419f |
+++ b/test/units/testsuite-02.sh
|
|
|
8d419f |
@@ -49,6 +49,7 @@ function report_result() {
|
|
|
8d419f |
systemd-cat cat "/$name.log"
|
|
|
8d419f |
}
|
|
|
8d419f |
|
|
|
8d419f |
+set +x
|
|
|
8d419f |
# Associative array for running tasks, where running[test-path]=PID
|
|
|
8d419f |
declare -A running=()
|
|
|
8d419f |
for task in "${TEST_LIST[@]}"; do
|
|
|
8d419f |
@@ -72,6 +73,7 @@ for task in "${TEST_LIST[@]}"; do
|
|
|
8d419f |
done
|
|
|
8d419f |
|
|
|
8d419f |
if [[ -x $task ]]; then
|
|
|
8d419f |
+ echo "Executing test '$task'"
|
|
|
8d419f |
log_file="/${task##*/}.log"
|
|
|
8d419f |
$task &>"$log_file" &
|
|
|
8d419f |
running[$task]=$!
|
|
|
8d419f |
@@ -80,11 +82,14 @@ done
|
|
|
8d419f |
|
|
|
8d419f |
# Wait for remaining running tasks
|
|
|
8d419f |
for key in "${!running[@]}"; do
|
|
|
8d419f |
+ echo "Waiting for test '$key' to finish"
|
|
|
8d419f |
wait ${running[$key]} && ec=0 || ec=$?
|
|
|
8d419f |
report_result "$key" $ec
|
|
|
8d419f |
unset running["$key"]
|
|
|
8d419f |
done
|
|
|
8d419f |
|
|
|
8d419f |
+set -x
|
|
|
8d419f |
+
|
|
|
8d419f |
# Test logs are sometimes lost, as the system shuts down immediately after
|
|
|
8d419f |
journalctl --sync
|
|
|
8d419f |
|