mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-08 20:58:20 +03:00
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 &".
This commit is contained in:
parent
4273a041f1
commit
ad8c442a0b
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user