apparmor/utils/test
Georgia Garcia 21e5a721ab replace deprecated distutils with setuptools
Adds python3 setuptools as a build dependency for libapparmor

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/202
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/813
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2021-11-11 20:23:35 -03:00
..
wtmp-examples Add truncated and ancient wtmp example to tests 2021-10-24 17:24:43 +02:00
cleanprof_test.in Preserve 'hat' keyword in ProfileStorage 2021-05-23 18:19:28 +02:00
cleanprof_test.out Preserve 'hat' keyword in ProfileStorage 2021-05-23 18:19:28 +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 Fix extra profiles path in utils/test/logprof.conf 2021-07-13 21:09:35 +02:00
Makefile replace deprecated distutils with setuptools 2021-11-11 20:23:35 -03:00
README.md replace deprecated distutils with setuptools 2021-11-11 20:23:35 -03: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_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 aa-easyprof: use AppArmorException from apparmor.common 2021-08-24 22:35:59 +02:00
test-aa-notify.py use aa-notify --configdir in test-aa-notify.py 2020-10-29 21:24:15 +01:00
test-aa.py import is_skippable_file from apparmor.common 2021-08-24 22:47:39 +02:00
test-aare.py test that '\*' from audit.log gets correctly escaped 2020-04-13 19:46:05 +02:00
test-abi.py Increase include and abi rule test coverage to 100% 2021-04-15 00:24:38 +02:00
test-alias.py Use parse() instead of _parse() in LogprofHeaderTest 2021-03-07 18:28:27 +01:00
test-baserule.py Run severity tests with official severity.db 2021-04-14 21:37:53 +02:00
test-boolean.py Use parse() instead of _parse() in LogprofHeaderTest 2021-03-07 18:28:27 +01:00
test-capability.py Run severity tests with official severity.db 2021-04-14 21:37:53 +02:00
test-change_profile.py Use parse() instead of _parse() in LogprofHeaderTest 2021-03-07 18:28:27 +01:00
test-common.py Add combine_profname() to combine profile name parts into joint name 2021-04-15 12:53:07 +02:00
test-config.py use aa-logprof --configdir ../utils in profile testsuite 2020-10-29 21:24:15 +01:00
test-dbus.py Use parse() instead of _parse() in LogprofHeaderTest 2021-03-07 18:28:27 +01: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 Run severity tests with official severity.db 2021-04-14 21:37:53 +02:00
test-include.py Increase include and abi rule test coverage to 100% 2021-04-15 00:24:38 +02:00
test-libapparmor-test_multi.py import hasher from apparmor.common 2021-08-24 22:48:19 +02:00
test-logparser.py Drop unused 'pid' parameter from ReadLog.__init__() 2019-05-09 17:15:35 +02:00
test-minitools.py skip testing aa-unconfined if securityfs is not available 2020-12-25 21:24:42 +01:00
test-mount_parse.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-network.py Use parse() instead of _parse() in LogprofHeaderTest 2021-03-07 18:28:27 +01:00
test-notify.py Add tests for sane_timestamp 2021-10-24 17:24:43 +02:00
test-parser-simple-tests.py import is_skippable_file from apparmor.common 2021-08-24 22:47:39 +02:00
test-pivot_root_parse.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-profile-list.py ProfileList: add get_profile_and_childs() 2021-04-15 12:53:08 +02:00
test-profile-storage.py ProfileStorage: simplify tests for attachment 2021-08-16 19:59:05 +02:00
test-profiles.py Add option to skip reading specific profiles 2021-07-13 21:09:36 +02:00
test-ptrace.py Use parse() instead of _parse() in LogprofHeaderTest 2021-03-07 18:28:27 +01:00
test-regex_matches.py add re_match_include_parse() test with invalid rule name 2020-12-25 19:57:20 +01:00
test-rlimit.py Use parse() instead of _parse() in LogprofHeaderTest 2021-03-07 18:28:27 +01:00
test-severity.py SeverityVarsTest: Make order of variable replacements constant 2021-08-19 12:52:56 +02:00
test-signal.py Use parse() instead of _parse() in LogprofHeaderTest 2021-03-07 18:28:27 +01:00
test-translations.py Check hotkey conflicts case-insensitive 2020-10-31 20:21:29 +01:00
test-unix_parse.py make utils tests less verbose 2018-04-08 20:18:30 +02:00
test-variable.py Use parse() instead of _parse() in LogprofHeaderTest 2021-03-07 18:28:27 +01:00

Running individual tests

Python's unittest allows individual tests to be executed by specifying the class name and the test on the command line. When running tests individually, the unittest framework executes the "setUp" and "tearDown" methods automatically. For more information, refer to the unittest documentation.

Make sure to set the environment variables pointing to the in-tree apparmor modules, and the in-tree libapparmor and its python wrapper:

$ export PYTHONPATH=..:../../libraries/libapparmor/swig/python/build/$(/usr/bin/python3 -c "import sysconfig; print(\"lib.%s-%s\" %(sysconfig.get_platform(), sysconfig.get_python_version()))")
$ export __AA_CONFDIR=.

To execute the test individually, run:

$ python3 ./test-tile.py ClassFoo.test_bar