teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0181-test-make-helper_check_device_units-log-unit-name.patch

ac3a84
From 54c173eb34da7c94953ed3556b448da13a4dc5fa Mon Sep 17 00:00:00 2001
ac3a84
From: Yu Watanabe <watanabe.yu+github@gmail.com>
ac3a84
Date: Wed, 1 Feb 2023 23:03:54 +0900
ac3a84
Subject: [PATCH] test: make helper_check_device_units() log unit name
ac3a84
ac3a84
(cherry picked from commit 5479d0f83a80810c475b14fbaf61872f4df6b20e)
ac3a84
ac3a84
Related: #2138081
ac3a84
---
ac3a84
 test/units/testsuite-64.sh | 7 ++++---
ac3a84
 1 file changed, 4 insertions(+), 3 deletions(-)
ac3a84
ac3a84
diff --git a/test/units/testsuite-64.sh b/test/units/testsuite-64.sh
ac3a84
index fd1ad7c041..c572671c20 100755
ac3a84
--- a/test/units/testsuite-64.sh
ac3a84
+++ b/test/units/testsuite-64.sh
ac3a84
@@ -89,6 +89,8 @@ check_device_unit() {(
ac3a84
     path="${2?}"
ac3a84
     unit=$(systemd-escape --path --suffix=device "$path")
ac3a84
 
ac3a84
+    [[ "$log_level" == 1 ]] && echo "INFO: check_device_unit($unit)"
ac3a84
+
ac3a84
     syspath=$(systemctl show --value --property SysFSPath "$unit" 2>/dev/null)
ac3a84
     if [[ -z "$syspath" ]]; then
ac3a84
         [[ "$log_level" == 1 ]] && echo >&2 "ERROR: $unit not found."
ac3a84
@@ -156,12 +158,11 @@ helper_check_device_units() {(
ac3a84
 
ac3a84
     local i
ac3a84
 
ac3a84
-    for ((i = 0; i < 20; i++)); do
ac3a84
-        (( i == 0 )) || sleep .5
ac3a84
-
ac3a84
+    for (( i = 0; i < 20; i++ )); do
ac3a84
         if check_device_units 0 "$@"; then
ac3a84
             return 0
ac3a84
         fi
ac3a84
+        sleep .5
ac3a84
     done
ac3a84
 
ac3a84
     check_device_units 1 "$@"