Merge pull request #24865 from yuwata/udevadm-tweaks

udevadm: fix misleading error message
This commit is contained in:
Frantisek Sumsal 2022-09-30 00:01:48 +02:00 committed by GitHub
commit 9b2e40a885
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View file

@ -72,6 +72,10 @@ int find_device(const char *id, const char *prefix, sd_device **ret) {
return 0;
}
/* if a path is provided, then it cannot be a unit name. Let's return earlier. */
if (is_path(id))
return -ENODEV;
/* Check if the argument looks like a device unit name. */
return find_device_from_unit(id, ret);
}

View file

@ -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