![]() - Tests defined in utils/test are now described by a task.yaml in the same directory and can run concurrently across many machines. - Tests for utils/ are now executed on openSUSE Tumbleweed since ttk themes is no longer a hard dependency in master. - Tests no longer run on openSUSE Leap 15.6 due to the age of default Python (3.6) and gcc/g++. The tight integration with SWIG which does not seem to support other Python versions very well. Perl hard-codes old GCC for extension modules. The upcoming openSUSE Leap 16 should be a viable target. In the meantime we can still test everything through rolling-release Tumbleweed. - Formatting of YAML files is now more uniform, at four spaces per tab. - The run-spread.sh script is now in the root of the tree. The script allows running all spread tests sequentially on one system, while collecting logs and artifacts for convenient analysis after the fact. - All systems are adjusted to run _four_ workers in parallel with _two_ virtual cores each and equipped with 1.5GB of virtual memory. This aims to best utilize the capacity of a typical CI worker with two to four cores and about 8GB of available memory. - Failing tests are marked as such, so that as a whole the entire spread suite can pass and be useful at catching regressions. Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com> |
||
---|---|---|
.. | ||
logprof | ||
wtmp-examples | ||
cleanprof_test.complain | ||
cleanprof_test.in | ||
cleanprof_test.out | ||
common_test.py | ||
easyprof.conf | ||
logprof.conf | ||
Makefile | ||
README.md | ||
runtests-py3.sh | ||
severity.db | ||
severity_broken.db | ||
task.yaml | ||
test-aa-cli-bootstrap.py | ||
test-aa-decode.py | ||
test-aa-easyprof.py | ||
test-aa-notify.py | ||
test-aa.py | ||
test-aare.py | ||
test-abi.py | ||
test-alias.py | ||
test-all.py | ||
test-baserule.py | ||
test-boolean.py | ||
test-capability.py | ||
test-change_profile.py | ||
test-common.py | ||
test-config.py | ||
test-dbus.py | ||
test-example.py | ||
test-file.py | ||
test-include.py | ||
test-io_uring.py | ||
test-libapparmor-test_multi.py | ||
test-logparser.py | ||
test-logprof.py | ||
test-minitools.py | ||
test-mount.py | ||
test-mqueue.py | ||
test-network.py | ||
test-notify.py | ||
test-parser-simple-tests.py | ||
test-pivot_root.py | ||
test-profile-list.py | ||
test-profile-storage.py | ||
test-profiles.py | ||
test-ptrace.py | ||
test-regex_matches.py | ||
test-rlimit.py | ||
test-severity.py | ||
test-signal.py | ||
test-translations.py | ||
test-unix.py | ||
test-userns.py | ||
test-variable.py |
Test data generated elsewhere
The tests in parser
generate additional test profiles in
parser/tst/simple_tests/
: see gen-dbus.py
and gen-xtrans.py
.
utils/test/test-parser-simple-tests.py
uses this test data when it is
available. If this test data has not been generated, this test will not
complain: it will simply exercise fewer test profiles.
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 ../../libraries/libapparmor/swig/python/test/buildpath.py)
$ export __AA_CONFDIR=.
To execute the test individually, run:
$ python3 ./test-tile.py ClassFoo.test_bar