]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: match all messages with the FILE field
authorFrantisek Sumsal <frantisek@sumsal.cz>
Sat, 29 Apr 2023 07:33:18 +0000 (09:33 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Sat, 29 Apr 2023 14:58:40 +0000 (16:58 +0200)
As the systemd-pstore process is quite short lived, it might sometimes
lack the necessary metadata to make matching against a unit or a syslog
tag work. Since we already use a cursor file to make the matching window
small as possible, let's just drop the unit match completely and hope
for the best.

Resolves: #27453

test/units/testsuite-74.pstore.sh

index b4e442c1bea0033d845f2257cd93b8f1e6b2a9ab..b8bf5534a10e3e8d5ffc73a64aaa1640954e4ad2 100755 (executable)
@@ -150,7 +150,7 @@ for unlink in yes no; do
     [[ "$(file_count /sys/fs/pstore)" -ge "$exp_count" ]]
     [[ "$(file_count /var/lib/systemd/pstore/)" -ne 0 ]]
     # We always log to journal
-    diff "$DUMMY_DMESG_1" <(journalctl -o cat -u systemd-pstore --output-fields=FILE --cursor-file=/tmp/journal.cursor | sed "/^$/d")
+    diff "$DUMMY_DMESG_1" <(journalctl -o cat --output-fields=FILE --cursor-file=/tmp/journal.cursor | sed "/^$/d")
     filename="$(printf "/var/lib/systemd/pstore/%s/%0.3d/dmesg.txt" "$timestamp" "$(file_size "$DUMMY_DMESG_1")")"
     diff "$DUMMY_DMESG_1" "$filename"
 
@@ -180,7 +180,7 @@ for unlink in yes no; do
     start_pstore
     [[ "$(file_count /sys/fs/pstore)" -ge "$exp_count" ]]
     [[ "$(file_count /var/lib/systemd/pstore/)" -eq 0 ]]
-    diff "$DUMMY_DMESG_1" <(journalctl -o cat -u systemd-pstore --output-fields=FILE --cursor-file=/tmp/journal.cursor | sed "/^$/d")
+    diff "$DUMMY_DMESG_1" <(journalctl -o cat --output-fields=FILE --cursor-file=/tmp/journal.cursor | sed "/^$/d")
 
     : "Backend: ERST; Storage: external; Unlink: $unlink"
     prepare_pstore_config "external" "$unlink"
@@ -190,7 +190,7 @@ for unlink in yes no; do
     [[ "$(file_count /sys/fs/pstore)" -ge "$exp_count" ]]
     [[ "$(file_count /var/lib/systemd/pstore/)" -ne 0 ]]
     # We always log to journal
-    diff "$DUMMY_DMESG_1" <(journalctl -o cat -u systemd-pstore --output-fields=FILE --cursor-file=/tmp/journal.cursor | sed "/^$/d")
+    diff "$DUMMY_DMESG_1" <(journalctl -o cat --output-fields=FILE --cursor-file=/tmp/journal.cursor | sed "/^$/d")
     filename="$(printf "/var/lib/systemd/pstore/%0.16d/dmesg.txt" "$last_id")"
     diff "$DUMMY_DMESG_1" "$filename"
 
@@ -217,5 +217,5 @@ for unlink in yes no; do
     start_pstore
     [[ "$(file_count /sys/fs/pstore)" -ge "$exp_count" ]]
     [[ "$(file_count /var/lib/systemd/pstore/)" -eq 0 ]]
-    diff "$DUMMY_DMESG_1" <(journalctl -o cat -u systemd-pstore --output-fields=FILE --cursor-file=/tmp/journal.cursor | sed "/^$/d")
+    diff "$DUMMY_DMESG_1" <(journalctl -o cat --output-fields=FILE --cursor-file=/tmp/journal.cursor | sed "/^$/d")
 done