From de7883024b657a46f855318147d54ebfb4d49870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sun, 21 May 2023 20:29:38 +0200 Subject: [PATCH] test: test-logger: fix systemd journal usage `sd_journal_seek_tail()` is supposed to seek to the logical end of the journal, i.e. (always) after the last entry. A call to `sd_journal_previous()` is needed to seek to the last entry, so that `sd_journal_next()` can be called successfully in `find_in_journal()`. Without it, the journal would always stay at the end of the list of entries, so further `sd_journal_next()` calls would fail as there are no entries after the last. See: * https://github.com/systemd/systemd/issues/25369 * https://github.com/systemd/systemd/pull/26577 --- test/test-logger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test-logger.c b/test/test-logger.c index ad4f15ea7..3ad29da0b 100644 --- a/test/test-logger.c +++ b/test/test-logger.c @@ -504,7 +504,7 @@ PWTEST(logger_journal) } sd_journal_seek_tail(journal); - sd_journal_next(journal); + sd_journal_previous(journal); spa_scnprintf(token, sizeof(token), "MARK %s:%d", __func__, __LINE__); spa_logt_info(iface, &topic, "%s", token); @@ -572,7 +572,7 @@ PWTEST(logger_journal_chain) } sd_journal_seek_tail(journal); - sd_journal_next(journal); + sd_journal_previous(journal); spa_scnprintf(token, sizeof(token), "MARK %s:%d", __func__, __LINE__);