mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
TEST-04-JOURNAL: add test case for log filtering through syslog
For issue #38361.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/python3
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
import subprocess
|
||||
import syslog
|
||||
|
||||
if __name__ == '__main__':
|
||||
syslog.openlog(ident="logs-filtering", logoption=syslog.LOG_PID)
|
||||
syslog.syslog(syslog.LOG_NOTICE, "Logging from the service, and ~more~ foo bar")
|
||||
|
||||
subprocess.check_output(
|
||||
['journalctl', '--sync'],
|
||||
stdin=subprocess.DEVNULL,
|
||||
text=True)
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Log filtering unit
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/TEST-04-JOURNAL.units/logs-filtering-syslog.py
|
||||
SyslogLevel=notice
|
||||
LogLevelMax=info
|
||||
@@ -119,6 +119,7 @@ test_delegate() {
|
||||
}
|
||||
|
||||
test_service logs-filtering.service
|
||||
test_service logs-filtering-syslog.service
|
||||
test_delegate delegated-cgroup-filtering.service
|
||||
|
||||
systemctl log-level "$SAVED_LOG_LEVEL"
|
||||
|
||||
Reference in New Issue
Block a user