]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-sd-device: also exclude dm block devices
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 21 Jul 2025 19:35:25 +0000 (04:35 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 22 Jul 2025 00:04:42 +0000 (01:04 +0100)
To avoid the following error:
```
test_sd_device_one(/sys/devices/virtual/block/dm-9)
src/libsystemd/sd-device/test-sd-device.c:104: Assertion failed: Expected "sd_device_new_from_syspath(&dev, syspath)" to succeed, but got error: -19/ENODEV
```

This also updates outdates comment about CentOS CI.

src/libsystemd/sd-device/test-sd-device.c

index 7a1c40ca744cea15f51e2f364d82e7dc5c862440..c6a16c996a76febf028a339a276906ab8aa85eb7 100644 (file)
@@ -303,8 +303,12 @@ static void exclude_problematic_devices(sd_device_enumerator *e) {
          * disappear during running this test. Let's exclude them here for stability. */
         ASSERT_OK(sd_device_enumerator_add_match_subsystem(e, "bdi", false));
         ASSERT_OK(sd_device_enumerator_add_nomatch_sysname(e, "loop*"));
-        /* On CentOS CI, systemd-networkd-tests.py may be running when this test is invoked. The networkd
-         * test creates and removes many network interfaces, and may interfere with this test. */
+        /* On some CI environments, it seems dm block devices sometimes disappear during running this test.
+         * Let's exclude them here for stability. */
+        ASSERT_OK(sd_device_enumerator_add_nomatch_sysname(e, "dm-*"));
+        /* Several other unit tests create and remove virtual network interfaces, e.g. test-netlink and
+         * test-local-addresses. When one of these tests run in parallel with this unit test, the enumerated
+         * device may disappear. Let's exclude them here for stability. */
         ASSERT_OK(sd_device_enumerator_add_match_subsystem(e, "net", false));
 }