]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: use notice log level to make easily filter out logs from PID1
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 6 Feb 2023 13:49:35 +0000 (22:49 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 6 Feb 2023 13:50:03 +0000 (22:50 +0900)
test/testsuite-04.units/logs-filtering.service
test/units/testsuite-04.sh

index fc89021ca984ff23d0154720fcbdfc16faa08b2c..06210868fd2719ff0a552c4ec052d6d5f3512006 100644 (file)
@@ -3,3 +3,4 @@ Description=Log filtering unit
 
 [Service]
 ExecStart=sh -c 'while true; do echo "Logging from the service, and ~more~"; sleep .25; done'
+SyslogLevel=notice
index 2874fc778f9de924410687b5b004008f29f27952..d10a9afbf7cb992d4cf2df4489268ce40cee870d 100755 (executable)
@@ -199,7 +199,7 @@ function run_service_and_fetch_logs() {
     journalctl --sync
     END=$(date '+%Y-%m-%d %T.%6N')
 
-    journalctl -q -u "$UNIT" -S "$START" -U "$END" | grep -Pv "systemd\[[0-9]+\]"
+    journalctl -q -u "$UNIT" -S "$START" -U "$END" -p notice
     systemctl stop "$UNIT"
 }