]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: clean up the new test case a bit
authorFrantisek Sumsal <fsumsal@redhat.com>
Fri, 16 Jun 2023 07:56:32 +0000 (09:56 +0200)
committerFrantisek Sumsal <fsumsal@redhat.com>
Fri, 16 Jun 2023 07:56:32 +0000 (09:56 +0200)
Follow-up to 61cecfa0d8.

test/TEST-04-JOURNAL/test.sh
test/units/testsuite-04.journal.sh

index 09516d11f5a976be7883c4901845cf33b77761d1..507dace51492e1a464ca7cf0c1dc35c76a142182 100755 (executable)
@@ -14,10 +14,6 @@ test_append_files() {
     cp -av "${TEST_BASE_DIR:?}/test-journals/"* "$workspace/test-journals/"
 
     inst_binary unzstd
-
-    (
-        command -v logger >/dev/null 2>&1 && inst_binary logger
-    )
 }
 
 do_test "$@"
index 58c3661391c80ac299f62c52befc8971521ce8d1..5e8a0235c5057b34fda56946e48988eae86fd756 100755 (executable)
@@ -52,15 +52,13 @@ grep -q '^PRIORITY=6$' /tmp/output
 (! grep '^SYSLOG_FACILITY=' /tmp/output)
 
 # --truncate shows only first line, skip under asan due to logger
-if [ -z "${ASAN_OPTIONS+x}${UBSAN_OPTIONS+x}" ] && command -v logger >/dev/null 2>&1 ;then
-    ID=$(journalctl --new-id128 | sed -n 2p)
-    logger -t "$ID" $'HEAD\nTAIL\nTAIL'
-    journalctl --sync
-    journalctl -q -b -t "$ID" | grep -q HEAD
-    journalctl -q -b -t "$ID" | grep -q TAIL
-    journalctl -q -b -t "$ID" --truncate-newline | grep -q HEAD
-    journalctl -q -b -t "$ID" --truncate-newline | grep -q -v TAIL
-fi
+ID="$(systemd-id128 new)"
+echo -e 'HEAD\nTAIL\nTAIL' | systemd-cat -t "$ID"
+journalctl --sync
+journalctl -b -t "$ID" | grep -q HEAD
+journalctl -b -t "$ID" | grep -q TAIL
+journalctl -b -t "$ID" --truncate-newline | grep -q HEAD
+journalctl -b -t "$ID" --truncate-newline | grep -q -v TAIL
 
 # '-b all' negates earlier use of -b (-b and -m are otherwise exclusive)
 journalctl -b -1 -b all -m >/dev/null