apparmor/utils/test
Christian Boltz 6b63f49ad4
Remove a level of indirection on logparser.py
logparser.py puts each log event on a big "stack" in self.pid. Later,
handle_children() in aa.py then converts that (named 'log' in aa.py) to
the prelog hasher.

This commit changes logparser.py to create the prelog structure itsself
(named hashlog), which
- removes one level of indirection
- probably saves some memory because the hashlog automatically
  de-duplicates events

This commit does this for capability, network and signal events, and
adds the infrastructure needed for all event/rule types.

In aa.py, the new function handle_hashlog() copies the hashlog content
to prelog. OTOH, the now superfluous code handling capability, network
and signal events gets removed from handle_children().
Long-term, hashlog will replace log in aa.py. When this is done,
handle_hashlog() will be replaced by a simple prelog = hashlog.

logparser.py gets a new function init_hashlog() to initialize hashlog
for each profile. It also gets changed to store capability, network and
signal events into hashlog instead of storing them in self.pid.

hashlog uses the full profile name as key, which is the first baby step
to support nested child profiles. (for now, handle_hashlog() still
splits the profile name into profile and hat.)

Known issue: The new implementation doesn't handle exec yet, which means
that events get lost at the exec boundary (= in cases aa-logprof asks
which execute mode to use). This will be fixed in a later commit.
2019-05-01 21:22:36 +02:00
..
cleanprof_test.in Update and extend cleanprof tests for link rules 2019-04-22 23:41:08 +02:00
cleanprof_test.out Update and extend cleanprof tests for link rules 2019-04-22 23:41:08 +02:00
common_test.py utils: Require apparmor.aa users to call init_aa() 2017-03-02 21:21:53 +00:00
easyprof.conf This patchset is broken into 4 parts: 2012-05-07 22:37:48 -07:00
fake_ldd utils: fixup test-aa.py tests that fail due to usr-merge 2019-02-12 23:17:59 -08:00
logprof.conf utils: Update the logprof.conf in the test dir to point to in-tree paths 2017-03-02 21:21:21 +00:00
Makefile Re-implement aa-notify in Python (Closes: #16) 2019-04-21 18:37:10 +03:00
minitools_test.py change_profile_flags: use ', ' as flags delimiter 2018-07-25 21:33:22 +02:00
runtests-py2.sh utils/tests: fix bashisms in runtests-py2.sh 2014-09-03 13:00:33 -07:00
runtests-py3.sh fix utils/test/runtests-py*.sh exitcode 2014-10-03 11:48:21 +02:00
severity.db Update perl abstraction, logprof.conf, severity.db and tests for Debian/Ubuntu 2014-08-20 19:14:24 -05:00
severity_broken.db Update perl abstraction, logprof.conf, severity.db and tests for Debian/Ubuntu 2014-08-20 19:14:24 -05:00
test-aa-cli-bootstrap.py Add tests for shared aa library functions used in command line scripts 2019-04-21 18:37:10 +03:00
test-aa-decode.py Bugfix aa-decode test: Get stderr correctly, don't ignore stderr contents 2019-02-05 00:15:13 +02:00
test-aa-easyprof.py Replace deprecated assertEquals with assertEqual 2019-02-26 21:27:00 +01:00
test-aa-notify.py aa-notify: Use fixed output width in tests so results always look same 2019-04-21 18:37:10 +03:00
test-aa.py parse_profile_start: test with un-named profile 2019-04-22 12:38:38 +02:00
test-aamode.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-aare.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-baserule.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-capability.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-change_profile.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-common.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-config.py utils: Update the logprof.conf in the test dir to point to in-tree paths 2017-03-02 21:21:21 +00:00
test-dbus.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-example.py add an example for setup_aa() to test-example.py 2019-02-10 23:24:29 +01:00
test-file.py Add tests for link rules to test-file.py 2019-04-22 23:39:47 +02:00
test-libapparmor-test_multi.py Remove a level of indirection on logparser.py 2019-05-01 21:22:36 +02:00
test-logparser.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-mount_parse.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-network.py update network keyword list in utils and add test 2019-03-16 12:52:37 +01:00
test-parser-simple-tests.py Remove 'owner link' tests from list of known-broken tests 2019-04-23 00:22:25 +02:00
test-pivot_root_parse.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-profile-list.py Add some tests for complex profile names 2019-03-31 17:34:55 +02:00
test-profile-storage.py extend add_or_remove_flag() to handle str for old flags 2018-07-25 20:59:34 +02:00
test-ptrace.py add some tests for BaseRule/BaseRuleset 2018-06-09 20:53:53 +02:00
test-regex_matches.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-rlimit.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-severity.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-signal.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-translations.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-unix_parse.py make utils tests less verbose 2018-04-08 20:18:30 +02:00