mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-01 06:45:38 +00:00
Accept more log formats in logparser.py
logparser.py does a regex check on log lines as performance improvement so that it only hands over lines that look like AppArmor events to LibAppArmor parsing. Those regexes were incomplete and didn't cover all log formats LibAppArmor accepts, with the end result of "overlooking" events. This patch splits off common parts of the regex, adds more regexes for several log types and finally merges everything into one regex. test-libapparmor-test_multi.py now also checks all test_multi log lines against the regex to ensure logparser.py doesn't silently ignore events. test-logparser.py gets adjusted to the merged RE_LOG_ALL regex. Finally, add a new test that was posted on IRC to the test_multi set. As already threatened nearly a month ago, Acked by <timeout> for trunk and 2.9
This commit is contained in:
@@ -44,6 +44,10 @@ class TestLibapparmorTestMulti(AATest):
|
||||
if parsed_event and expected:
|
||||
parsed_items = dict(parsed_event.items())
|
||||
|
||||
# check if the line passes the regex in logparser.py
|
||||
if not parser.RE_LOG_ALL.search(loglines2[0]):
|
||||
raise Exception("Log event doesn't match RE_LOG_ALL")
|
||||
|
||||
for label in expected:
|
||||
if label in [
|
||||
'file', # filename of the *.in file
|
||||
|
Reference in New Issue
Block a user