]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-17-UDEV: wait for udevd being restarted after exit control command
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 7 Jan 2025 11:23:02 +0000 (20:23 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 7 Jan 2025 11:31:15 +0000 (20:31 +0900)
Also wait for created devices being processed before running tests.

test/units/TEST-17-UDEV.10.sh

index 7ca05f5287fed488c9698a36e799052def938d08..afa05909c40a909204f379a55d63f1e175b8e260 100755 (executable)
@@ -28,9 +28,15 @@ blk="$(mktemp)"
 dd if=/dev/zero of="$blk" bs=1M count=1
 loopdev="$(losetup --show -f "$blk")"
 
+# Wait for devices created in the above being processed.
+udevadm settle --timeout 30
+
 udevadm -h
 
+INVOCATION_ID=$(systemctl show --property InvocationID --value systemd-udevd.service)
 udevadm control -e
+# Wait for systemd-udevd.service being restarted.
+timeout 30 bash -ec "while [[ \"\$(systemctl show --property InvocationID --value systemd-udevd.service)\" == \"$INVOCATION_ID\" ]]; do sleep .5; done"
 udevadm control -l emerg
 udevadm control -l alert
 udevadm control -l crit