assert_se(sd_device_enumerator_new(&e) >= 0);
assert_se(sd_device_enumerator_allow_uninitialized(e) >= 0);
+ /* On some CI environments, it seems some loop block devices and corresponding bdi devices sometimes
+ * disappear during running this test. Let's exclude them here for stability. */
+ assert_se(sd_device_enumerator_add_match_subsystem(e, "bdi", false) >= 0);
+ assert_se(sd_device_enumerator_add_nomatch_sysname(e, "loop*") >= 0);
FOREACH_DEVICE(e, d)
test_sd_device_one(d);
}
assert_se(sd_device_enumerator_new(&e) >= 0);
assert_se(sd_device_enumerator_add_match_subsystem(e, subsystem, true) >= 0);
+ if (streq(subsystem, "block"))
+ assert_se(sd_device_enumerator_add_nomatch_sysname(e, "loop*") >= 0);
FOREACH_DEVICE(e, d) {
const char *syspath;
assert_se(subsystems = hashmap_new(&string_hash_ops));
assert_se(sd_device_enumerator_new(&e) >= 0);
+ /* See comments in TEST(sd_device_enumerator_devices). */
+ assert_se(sd_device_enumerator_add_match_subsystem(e, "bdi", false) >= 0);
+ assert_se(sd_device_enumerator_add_nomatch_sysname(e, "loop*") >= 0);
FOREACH_DEVICE(e, d) {
const char *syspath, *subsystem;