mirror of
https://github.com/systemd/systemd.git
synced 2025-02-25 21:57:32 +03:00
TEST-17-UDEV: check if udev database file is removed on remove event
This commit is contained in:
parent
e8df18c9e1
commit
49c46fbaf1
22
test/units/TEST-17-UDEV.database.sh
Executable file
22
test/units/TEST-17-UDEV.database.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/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
|
Loading…
x
Reference in New Issue
Block a user