diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-10-14 17:49:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-14 17:49:37 +0200 |
commit | fc8bc57f6b25266ab52166c917b39a3abf2fa54d (patch) | |
tree | 546a8bccaafed177d07faf3c2c67635caed34707 /test | |
parent | Merge pull request #17338 from poettering/close-range (diff) | |
parent | test: add test for device renaming issue #16967 (diff) | |
download | systemd-fc8bc57f6b25266ab52166c917b39a3abf2fa54d.tar.xz systemd-fc8bc57f6b25266ab52166c917b39a3abf2fa54d.zip |
Merge pull request #16968 from yuwata/remove-old-device-on-move-event
core, udev: remove old device on move event
Diffstat (limited to 'test')
-rwxr-xr-x | test/TEST-29-UDEV-ID_RENAMING/test.sh | 15 | ||||
-rwxr-xr-x | test/units/testsuite-29.sh | 16 |
2 files changed, 31 insertions, 0 deletions
diff --git a/test/TEST-29-UDEV-ID_RENAMING/test.sh b/test/TEST-29-UDEV-ID_RENAMING/test.sh index 4feafc04d7..ddf6db9735 100755 --- a/test/TEST-29-UDEV-ID_RENAMING/test.sh +++ b/test/TEST-29-UDEV-ID_RENAMING/test.sh @@ -1,9 +1,24 @@ #!/usr/bin/env bash set -e TEST_DESCRIPTION="UDEV ID_RENAMING property" +IMAGE_NAME="udev-id-renaming" TEST_NO_NSPAWN=1 . $TEST_BASE_DIR/test-functions 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 diff --git a/test/units/testsuite-29.sh b/test/units/testsuite-29.sh index 5abdb53eb3..5c62556895 100755 --- a/test/units/testsuite-29.sh +++ b/test/units/testsuite-29.sh @@ -38,6 +38,22 @@ STATE=$(systemctl show --property=ActiveState --value sys-devices-virtual-net-lo rm -f /run/udev/rules.d/50-testsuite.rules 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 exit 0 |