mirror of
https://github.com/systemd/systemd.git
synced 2025-03-08 08:58:27 +03:00
test: make the busy loop in TEST-02 less verbose
as it unnecessarily clogs the logs.
This commit is contained in:
parent
01d81c126b
commit
582547cbd3
@ -49,6 +49,7 @@ function report_result() {
|
||||
systemd-cat cat "/$name.log"
|
||||
}
|
||||
|
||||
set +x
|
||||
# Associative array for running tasks, where running[test-path]=PID
|
||||
declare -A running=()
|
||||
for task in "${TEST_LIST[@]}"; do
|
||||
@ -72,6 +73,7 @@ for task in "${TEST_LIST[@]}"; do
|
||||
done
|
||||
|
||||
if [[ -x $task ]]; then
|
||||
echo "Executing test '$task'"
|
||||
log_file="/${task##*/}.log"
|
||||
$task &>"$log_file" &
|
||||
running[$task]=$!
|
||||
@ -80,11 +82,14 @@ done
|
||||
|
||||
# Wait for remaining running tasks
|
||||
for key in "${!running[@]}"; do
|
||||
echo "Waiting for test '$key' to finish"
|
||||
wait ${running[$key]} && ec=0 || ec=$?
|
||||
report_result "$key" $ec
|
||||
unset running["$key"]
|
||||
done
|
||||
|
||||
set -x
|
||||
|
||||
# Test logs are sometimes lost, as the system shuts down immediately after
|
||||
journalctl --sync
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user