|
11 | 11 | from infamy.util import parallel, until |
12 | 12 |
|
13 | 13 | TEST_MESSAGES = [ |
14 | | - ("daemon.emerg", "Emergency: system is unusable"), |
15 | | - ("daemon.alert", "Alert: immediate action required"), |
16 | | - ("daemon.crit", "Critical: critical condition"), |
17 | | - ("daemon.err", "Error: error condition"), |
18 | | - ("daemon.warning", "Warning: warning condition"), |
19 | | - ("daemon.notice", "Notice: normal but significant"), |
20 | | - ("daemon.info", "Info: informational message"), |
21 | | - ("daemon.debug", "Debug: debug-level message"), |
| 14 | + ("emergency", "Emergency: system is unusable"), |
| 15 | + ("alert", "Alert: immediate action required"), |
| 16 | + ("critical", "Critical: critical condition"), |
| 17 | + ("error", "Error: error condition"), |
| 18 | + ("warning", "Warning: warning condition"), |
| 19 | + ("notice", "Notice: normal but significant"), |
| 20 | + ("info", "Info: informational message"), |
| 21 | + ("debug", "Debug: debug-level message"), |
22 | 22 | ] |
23 | 23 |
|
24 | 24 | with infamy.Test() as test: |
|
76 | 76 | until(lambda: tgtssh.runsh("test -f /var/log/exact-errors").returncode == 0, attempts=10) |
77 | 77 |
|
78 | 78 | with test.step("Send test messages at all severity levels"): |
79 | | - for priority, message in TEST_MESSAGES: |
80 | | - tgtssh.runsh(f"logger -t advtest -p {priority} '{message}'") |
| 79 | + for severity, message in TEST_MESSAGES: |
| 80 | + target.log(message, severity=severity, facility="daemon", app_name="advtest") |
81 | 81 | until(lambda: "Error: error condition" in tgtssh.runsh("cat /var/log/exact-errors 2>/dev/null").stdout, attempts=10) |
82 | 82 |
|
83 | 83 | with test.step("Verify exact-errors log contains only error messages"): |
|
0 commit comments