diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2022-10-07 17:17:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-07 17:17:08 (GMT) |
commit | cae7d1d7a713f8267daf5e4f2fff5cb1dad02c7c (patch) | |
tree | 22139067d2e742e9ea2b904b083f33d4d3baffe2 /Lib/test/audit-tests.py | |
parent | 80b3e32d6242c27094dd04c4c3d0c3d3b2889a01 (diff) | |
download | cpython-cae7d1d7a713f8267daf5e4f2fff5cb1dad02c7c.zip cpython-cae7d1d7a713f8267daf5e4f2fff5cb1dad02c7c.tar.gz cpython-cae7d1d7a713f8267daf5e4f2fff5cb1dad02c7c.tar.bz2 |
Add more syslog tests (GH-97953)
Diffstat (limited to 'Lib/test/audit-tests.py')
-rw-r--r-- | Lib/test/audit-tests.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Lib/test/audit-tests.py b/Lib/test/audit-tests.py index 66c08f7..4abf33d 100644 --- a/Lib/test/audit-tests.py +++ b/Lib/test/audit-tests.py @@ -429,6 +429,26 @@ def test_wmi_exec_query(): sys.addaudithook(hook) _wmi.exec_query("SELECT * FROM Win32_OperatingSystem") +def test_syslog(): + import syslog + + def hook(event, args): + if event.startswith("syslog."): + print(event, *args) + + sys.addaudithook(hook) + syslog.openlog('python') + syslog.syslog('test') + syslog.setlogmask(syslog.LOG_DEBUG) + syslog.closelog() + # implicit open + syslog.syslog('test2') + # open with default ident + syslog.openlog(logoption=syslog.LOG_NDELAY, facility=syslog.LOG_LOCAL0) + sys.argv = None + syslog.openlog() + syslog.closelog() + if __name__ == "__main__": from test.support import suppress_msvcrt_asserts |