test: add test for device renaming issue #16967
This commit is contained in:
parent
6d4bcea4ca
commit
efdaeb88f0
|
@ -1,9 +1,24 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
TEST_DESCRIPTION="UDEV ID_RENAMING property"
|
TEST_DESCRIPTION="UDEV ID_RENAMING property"
|
||||||
|
IMAGE_NAME="udev-id-renaming"
|
||||||
TEST_NO_NSPAWN=1
|
TEST_NO_NSPAWN=1
|
||||||
|
|
||||||
. $TEST_BASE_DIR/test-functions
|
. $TEST_BASE_DIR/test-functions
|
||||||
QEMU_TIMEOUT=300
|
QEMU_TIMEOUT=300
|
||||||
|
|
||||||
|
test_create_image() {
|
||||||
|
create_empty_image_rootdir
|
||||||
|
|
||||||
|
# Create what will eventually be our root filesystem onto an overlay
|
||||||
|
(
|
||||||
|
LOG_LEVEL=5
|
||||||
|
setup_basic_environment
|
||||||
|
mask_supporting_services
|
||||||
|
|
||||||
|
instmods dummy
|
||||||
|
generate_module_dependencies
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
do_test "$@" 29
|
do_test "$@" 29
|
||||||
|
|
|
@ -38,6 +38,22 @@ STATE=$(systemctl show --property=ActiveState --value sys-devices-virtual-net-lo
|
||||||
rm -f /run/udev/rules.d/50-testsuite.rules
|
rm -f /run/udev/rules.d/50-testsuite.rules
|
||||||
udevadm control --reload --timeout=600
|
udevadm control --reload --timeout=600
|
||||||
|
|
||||||
|
# test for issue #16967
|
||||||
|
|
||||||
|
ip link add hoge type dummy
|
||||||
|
udevadm info --wait-for-initialization=10s /sys/devices/virtual/net/hoge
|
||||||
|
sleep 1
|
||||||
|
if ! systemctl status sys-devices-virtual-net-hoge.device; then exit 1; fi
|
||||||
|
if ! systemctl status sys-subsystem-net-devices-hoge.device; then exit 1; fi
|
||||||
|
|
||||||
|
ip link set hoge name foobar
|
||||||
|
udevadm info --wait-for-initialization=10s /sys/devices/virtual/net/foobar
|
||||||
|
sleep 1
|
||||||
|
if systemctl status sys-devices-virtual-net-hoge.device; then exit 1; fi
|
||||||
|
if systemctl status sys-subsystem-net-devices-hoge.device; then exit 1; fi
|
||||||
|
if ! systemctl status sys-devices-virtual-net-foobar.device; then exit 1; fi
|
||||||
|
if ! systemctl status sys-subsystem-net-devices-foobar.device; then exit 1; fi
|
||||||
|
|
||||||
echo OK > /testok
|
echo OK > /testok
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue