mirror of
https://github.com/flatpak/flatpak.git
synced 2026-04-16 04:51:43 -04:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user