]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-sd-device: filter out dm block devices at several more places
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 25 Jul 2025 00:30:01 +0000 (09:30 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 25 Jul 2025 10:03:31 +0000 (11:03 +0100)
Follow-up for 911a52b769e477fd13fbc84d9ac098b8c0298eaf.

Fixes #38332.

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

index c6a16c996a76febf028a339a276906ab8aa85eb7..e1ee9e433fbce74eeb5d8f1a0ac425d2dd03d1e0 100644 (file)
@@ -344,7 +344,7 @@ static void test_sd_device_enumerator_filter_subsystem_one(
 
         ASSERT_OK(sd_device_enumerator_new(&e));
         ASSERT_OK(sd_device_enumerator_add_match_subsystem(e, subsystem, true));
-        ASSERT_OK(sd_device_enumerator_add_nomatch_sysname(e, "loop*"));
+        exclude_problematic_devices(e);
 
         FOREACH_DEVICE(e, d) {
                 const char *syspath;
@@ -613,9 +613,9 @@ TEST(sd_device_enumerator_add_all_parents) {
         /* STEP 1: enumerate all block devices without all_parents() */
         ASSERT_OK(sd_device_enumerator_new(&e));
         ASSERT_OK(sd_device_enumerator_allow_uninitialized(e));
+        exclude_problematic_devices(e);
 
         /* filter in only a subsystem */
-        ASSERT_OK(sd_device_enumerator_add_nomatch_sysname(e, "loop*"));
         ASSERT_OK(sd_device_enumerator_add_match_subsystem(e, "block", true));
         ASSERT_OK(sd_device_enumerator_add_match_property(e, "DEVTYPE", "partition"));
 
@@ -758,8 +758,9 @@ TEST(sd_device_new_from_path) {
 
         ASSERT_OK(sd_device_enumerator_new(&e));
         ASSERT_OK(sd_device_enumerator_allow_uninitialized(e));
+        exclude_problematic_devices(e);
+
         ASSERT_OK(sd_device_enumerator_add_match_subsystem(e, "block", true));
-        ASSERT_OK(sd_device_enumerator_add_nomatch_sysname(e, "loop*"));
         ASSERT_OK(sd_device_enumerator_add_match_property(e, "DEVNAME", "*"));
 
         FOREACH_DEVICE(e, dev) {