]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: make helper_check_device_units() log unit name
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 1 Feb 2023 14:03:54 +0000 (23:03 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 1 Feb 2023 14:04:13 +0000 (23:04 +0900)
test/units/testsuite-64.sh

index c4406f381bf581659d7e557e85f8fa734982f269..d5ccad7e64a361a82231f0b8ea5c8d168ce56600 100755 (executable)
@@ -89,6 +89,8 @@ check_device_unit() {(
     path="${2?}"
     unit=$(systemd-escape --path --suffix=device "$path")
 
+    [[ "$log_level" == 1 ]] && echo "INFO: check_device_unit($unit)"
+
     syspath=$(systemctl show --value --property SysFSPath "$unit" 2>/dev/null)
     if [[ -z "$syspath" ]]; then
         [[ "$log_level" == 1 ]] && echo >&2 "ERROR: $unit not found."
@@ -156,12 +158,11 @@ helper_check_device_units() {(
 
     local i
 
-    for ((i = 0; i < 20; i++)); do
-        (( i == 0 )) || sleep .5
-
+    for (( i = 0; i < 20; i++ )); do
         if check_device_units 0 "$@"; then
             return 0
         fi
+        sleep .5
     done
 
     check_device_units 1 "$@"