From 0680e249e5587803163fb0cf01e51a20dd571395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Wed, 1 Dec 2021 10:50:28 +0100 Subject: [PATCH] test: test-logger: ignore some systemd journal error codes Some errors from `sd_journal_get_data()` are not (and should not be considered) fatal from the point of view of the test. Ignore them. See #1710 --- test/test-logger.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/test-logger.c b/test/test-logger.c index 338cd819c..a1b0ff01d 100644 --- a/test/test-logger.c +++ b/test/test-logger.c @@ -24,6 +24,7 @@ #include "pwtest.h" +#include #include #include @@ -464,6 +465,9 @@ find_in_journal(sd_journal *journal, const char *needle, char *out, size_t out_s const char *d; size_t l; int r = sd_journal_get_data(journal, "MESSAGE", (const void **)&d, &l); + if (r == -ENOENT || r == -E2BIG || r == -EBADMSG) + continue; + pwtest_neg_errno_ok(r); spa_scnprintf(buffer, sizeof(buffer), "%.*s", (int) l, d); if (strstr(buffer, needle)) {