]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: exclude network interfaces 23690/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 Jun 2022 06:38:51 +0000 (15:38 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 Jun 2022 09:44:21 +0000 (18:44 +0900)
After https://github.com/systemd/systemd-centos-ci/pull/492 is merged,
the networkd test may be running when test-sd-device is invoked.
Let's exclude net subsystem.

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

index 62e10ad65129bdbf7cc3bfb009628ee202d75640..ba7767ee493abf46bcfe7e3c6863f9c21948b1cd 100644 (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);
 }
@@ -261,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;