mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
Otherwise, if a test in a spurious state, it consumes quite long time. Let's fail earlier in such case. This also drops an unnecessary calls of 'udevadm settle' in testcase_nvme_basic() of TEST-64-UDEV-STORAGE.
23 lines
580 B
Bash
Executable File
23 lines
580 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
set -ex
|
|
set -o pipefail
|
|
|
|
udevadm control --log-level=debug
|
|
|
|
IFNAME=test-udev-aaa
|
|
ip link add "$IFNAME" type dummy
|
|
IFINDEX=$(ip -json link show "$IFNAME" | jq '.[].ifindex')
|
|
udevadm wait --timeout=10 "/sys/class/net/$IFNAME"
|
|
# Check if the database file is created.
|
|
[[ -e "/run/udev/data/n$IFINDEX" ]]
|
|
|
|
ip link del "$IFNAME"
|
|
udevadm wait --timeout=10 --removed --settle "/sys/class/net/$IFNAME"
|
|
# CHeck if the database file is removed.
|
|
[[ ! -e "/run/udev/data/n$IFINDEX" ]]
|
|
|
|
udevadm control --log-level=info
|
|
|
|
exit 0
|