teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame SOURCES/0246-test-make-the-busy-loop-in-TEST-02-less-verbose.patch

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