mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-09 02:41:03 +01:00

This patch adds TestLogToProfile to test-libapparmor-test_multi.py which "translates" the test_multi log sniplets to a profile, and checks if it matches the expected profile. The expected profile for one log event will obviously contain only one rule, and gets added as *.profile to the test_multi directory. This patch includes 33 test_multi profiles - which means 83 more need to be created. Whenever you have some time, add one or two! (Please write those test_multi profiles manually, without using the tools.) I know some parts of the test code looks complicated. Unfortunately this is how things work - compare it with do_logprof_pass() in aa.py... While on it, set tests = 'invalid' which ensures a failure in case parse_test_profiles() doesn't set the tests array, and move printing the test name out of parse_test_profiles() to avoid printing it twice. A nice side effect of this patch is increased test coverage: - 30% -> 40% in aa.py (= 250 more lines) - 52% -> 78% in aamode.py (= 23 more lines) - 26% -> 68% in logparser.py (= 120 more lines) - total coverage increases from 57% to 62% Acked-by: Seth Arnold <seth.arnold@canonical.com>
4 lines
41 B
Text
4 lines
41 B
Text
/home/steve/tmp/sh {
|
|
/etc/passwd r,
|
|
|
|
}
|