This MR closes#239. In the temporary file commit, `tempfile.NamedTemporaryFile` is preferred over `tempfile.mkstemp` because it allows for simpler use of context managers and lets you choose what mode to open the file in. Also in this commit, note that in `aa.py` and `easyprof.py` destination files are now written directly, instead of writing to temp files and then renaming them.
Closes#239
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/898
Approved-by: Christian Boltz <apparmor@cboltz.de>
Merged-by: Christian Boltz <apparmor@cboltz.de>
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: