From e807ca3539f453d543a6797a76418d218d2eeee2 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Mon, 24 Nov 2025 17:38:35 +0100 Subject: [PATCH] tests/test-history.sh: Make testing for working journalctl more robust journalctl also prints something when the message didn't make it to whatever journalctl connects to. Check for the specific message showing up instead to make sure it all works as expected. --- tests/test-history.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test-history.sh b/tests/test-history.sh index 556b7b21..9c3f1e53 100755 --- a/tests/test-history.sh +++ b/tests/test-history.sh @@ -15,13 +15,12 @@ skip_without_libsystemd HISTORY_START_TIME=$(date +"%Y-%m-%d %H:%M:%S") sleep 1 -if ! logger "Checking whether Flatpak can use the journal..."; then +MESSAGE="Checking whether Flatpak can use the journal..." +if ! logger "${MESSAGE}"; then skip "Cannot write to Journal with logger" fi -messages="$(journalctl --user --since="${HISTORY_START_TIME}" || true)" - -if [ -z "$messages" ]; then +if ! journalctl --user --since="${HISTORY_START_TIME}" | grep -q "${MESSAGE}"; then skip "Cannot read back from Journal with journalctl" fi