Merge pull request #23690 from yuwata/test-sd-device

test: several tweaks for test-sd-device
This commit is contained in:
Frantisek Sumsal
2022-06-10 14:50:01 +00:00
committed by GitHub

View File

@@ -189,6 +189,9 @@ TEST(sd_device_enumerator_devices) {
* 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);
/* 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. */
assert_se(sd_device_enumerator_add_match_subsystem(e, "net", false) >= 0);
FOREACH_DEVICE(e, d)
test_sd_device_one(d);
}
@@ -215,8 +218,7 @@ static void test_sd_device_enumerator_filter_subsystem_one(
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);
assert_se(sd_device_enumerator_add_nomatch_sysname(e, "loop*") >= 0);
FOREACH_DEVICE(e, d) {
const char *syspath;
@@ -262,6 +264,7 @@ TEST(sd_device_enumerator_filter_subsystem) {
/* 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);
assert_se(sd_device_enumerator_add_match_subsystem(e, "net", false) >= 0);
FOREACH_DEVICE(e, d) {
const char *syspath, *subsystem;