From: Yu Watanabe Date: Fri, 25 Jul 2025 00:30:01 +0000 (+0900) Subject: test-sd-device: filter out dm block devices at several more places X-Git-Tag: v258-rc2~88 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dda9eeb08114d0bb22c20bafde1062a8d0cf3e2f;p=thirdparty%2Fsystemd.git test-sd-device: filter out dm block devices at several more places Follow-up for 911a52b769e477fd13fbc84d9ac098b8c0298eaf. Fixes #38332. --- diff --git a/src/libsystemd/sd-device/test-sd-device.c b/src/libsystemd/sd-device/test-sd-device.c index c6a16c996a7..e1ee9e433fb 100644 --- a/src/libsystemd/sd-device/test-sd-device.c +++ b/src/libsystemd/sd-device/test-sd-device.c @@ -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) {