]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
varlink: don't try to talk to oomd from unit tests 21116/head
authorLennart Poettering <lennart@poettering.net>
Mon, 25 Oct 2021 08:39:32 +0000 (10:39 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 25 Oct 2021 08:45:22 +0000 (10:45 +0200)
Talking to external daemons we ourselves maintain is a job for the
integration tests, not the unit tests. This communication is likely to
fail hence don#t even bother.

This makes our tests a bit cleaner.

src/core/core-varlink.c

index 04d9d9641724a35e608587e7a3dd1ed8bdf280d3..ab0d45538048161cb3b54ec388b02542fbf58770 100644 (file)
@@ -562,6 +562,9 @@ static int manager_varlink_init_user(Manager *m) {
         if (m->managed_oom_varlink)
                 return 1;
 
+        if (MANAGER_IS_TEST_RUN(m))
+                return 0;
+
         r = varlink_connect_address(&link, VARLINK_ADDR_PATH_MANAGED_OOM_USER);
         if (r == -ENOENT || ERRNO_IS_DISCONNECT(r)) {
                 log_debug("systemd-oomd varlink unix socket not found, skipping user manager varlink setup");