From aea2d53e1d6f6ebb4e5ce23f29d0952441f1ab0a Mon Sep 17 00:00:00 2001 From: HuijingHei Date: Thu, 15 Aug 2024 11:32:17 +0800 Subject: [PATCH] ci: fix test failing for Duplicate lines in journal The "Duplicate line" log is happend during initramfs. From Jonathan's suggestion https://github.com/coreos/rpm-ostree/issues/5040#issuecomment-2288821807: we will ignore log entries from before switchroot when doing check. Fixes https://github.com/coreos/rpm-ostree/issues/5040 --- tests/kolainst/nondestructive/misc.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/kolainst/nondestructive/misc.sh b/tests/kolainst/nondestructive/misc.sh index c2d4b15bbb..40579912d5 100755 --- a/tests/kolainst/nondestructive/misc.sh +++ b/tests/kolainst/nondestructive/misc.sh @@ -41,8 +41,11 @@ assert_not_file_has_content $tmpfiles 'd /var/tmp' assert_not_file_has_content $tmpfiles 'd /var/cache ' assert_file_has_content_literal $tmpfiles 'd /var/lib/chrony 0750 chrony chrony - -' +# https://github.com/coreos/rpm-ostree/issues/5040 +# only check logs after switchroot +curosr=$(journalctl -u initrd-switch-root.service -o json -n 1 | jq -r '.["__CURSOR"]') set +x # so our grepping doesn't get a hit on itself -if journalctl --grep 'Duplicate line'; then +if journalctl -u systemd-tmpfiles-setup.service --after-cursor ${curosr} --grep 'Duplicate line'; then fatal "Should not get logs (Duplicate line)" fi set -x # restore