Skip to content

Draft: tests: fix profiles and utils tests to find and use the swig python libraries

Steve Beattie requested to merge smb/apparmor:ci-profiles-check into master

The fixes that landed for #98 (closed) are incomplete: they only added a check to ensure that the parser is built, and not libapparmor as well, and also didn't adjust the invocation of aa-logprof to actually make use of the built libapparmor or its swig python library.

Furthermore, neither it nor the tests in utils/ add the location of the swig libapparmor C library to the library search path, meaning that if the system one does not exist, it will not be found and the test will fail.

The first four patches in this series address the above, and are ready to land.

Fixing all the above still leaves the check-logprof test target in the profiles directory still leaves things in a fiaing state without system binaries available; utils/apparmor/aa.py:aa_init() will look for the existence of the system parser if there's not a parser specified in a configuration file and aa-logprof won't allow an alternate configuration directory to be specified. The fifth patch in the series attempts to address it by creating a stripped down version of aa-logprof for testing profiles, but needs some polishing. The sixth patch adjusts the gitlab ci to enable the check-logprof test as well.

The first four patch should also get cherrypicked to the prior releases that had the patch for #98 (closed) cherry-picked to them.

Edited by Steve Beattie

Merge request reports