diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-09-29 19:38:22 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-09-29 20:42:05 +0200 |
commit | ad8c442a0b5f2352d85959f757df718b4fc056e9 (patch) | |
tree | 994cd510bf7930c033659e7a171070626c08a80a /test/units/testsuite-64.sh | |
parent | udevadm: do not try to find device unit when a path like string is provided (diff) | |
download | systemd-ad8c442a0b5f2352d85959f757df718b4fc056e9.tar.xz systemd-ad8c442a0b5f2352d85959f757df718b4fc056e9.zip |
test-64-udev-storage: use wait command instead of hackish "udevadm lock true"
Otherwise, "udevadm lock true" may lock a block device earlier than
"udevadm lock sfdisk &".
Diffstat (limited to 'test/units/testsuite-64.sh')
-rwxr-xr-x | test/units/testsuite-64.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/units/testsuite-64.sh b/test/units/testsuite-64.sh index 0d4c4ff776..df92a0bb43 100755 --- a/test/units/testsuite-64.sh +++ b/test/units/testsuite-64.sh @@ -289,8 +289,9 @@ EOF } testcase_simultaneous_events() { - local disk expected i iterations link num_part part partscript rule target timeout + local disk expected i iterations key link num_part part partscript rule target timeout local -a devices symlinks + local -A running if [[ -n "${ASAN_OPTIONS:-}" ]] || [[ "$(systemd-detect-virt -v)" == "qemu" ]]; then num_part=2 @@ -346,11 +347,12 @@ EOF else udevadm lock --device="${devices[$disk]}" sfdisk -q -X gpt "${devices[$disk]}" <"$partscript" & fi + running[$disk]=$! done - # Wait for the above sfdisk commands to be finished. - for disk in {0..9}; do - udevadm lock --device="${devices[$disk]}" true + for key in "${!running[@]}"; do + wait "${running[$key]}" + unset "running[$key]" done if ((i % 10 <= 1)); then |