]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: do not enumerate units in MANAGER_TEST_RUN_MINIMAL mode
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 26 Jun 2019 12:56:59 +0000 (14:56 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 26 Jun 2019 14:25:36 +0000 (16:25 +0200)
In this mode we are not supposed to "interact with the environment", so loading
all units and printing warnings about syntax errors and /var/run usage seems
inappropriate.

src/core/manager.c

index 78f03a824c26c533a9ae89c5457369820d2f4694..0c1adf2850005b0002260cb88979d06e47c846c0 100644 (file)
@@ -1378,6 +1378,9 @@ static void manager_enumerate_perpetual(Manager *m) {
 
         assert(m);
 
+        if (m->test_run_flags == MANAGER_TEST_RUN_MINIMAL)
+                return;
+
         /* Let's ask every type to load all units from disk/kernel that it might know */
         for (c = 0; c < _UNIT_TYPE_MAX; c++) {
                 if (!unit_type_supported(c)) {
@@ -1395,6 +1398,9 @@ static void manager_enumerate(Manager *m) {
 
         assert(m);
 
+        if (m->test_run_flags == MANAGER_TEST_RUN_MINIMAL)
+                return;
+
         /* Let's ask every type to load all units from disk/kernel that it might know */
         for (c = 0; c < _UNIT_TYPE_MAX; c++) {
                 if (!unit_type_supported(c)) {