test-pivot_root_parse.py in apparmor failed with ImportError: No module named apparmor.aa
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QA Regression Testing |
New
|
Undecided
|
Unassigned | ||
ubuntu-kernel-tests |
New
|
Undecided
|
Unassigned | ||
apparmor (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
Bionic |
New
|
Undecided
|
Unassigned | ||
Focal |
New
|
Undecided
|
Unassigned |
Bug Description
Steps to reproduce:
# Via qa-regression-
git clone --depth=1 git://git.
cd qa-regression-
sudo python3 ./test-apparmor.py -v ApparmorTestsui
== Update base on John's comment in #1
Note that we cannot use apparmor cloned from launchpad directly, it requires some other local patches in qa-regression-
https:/
To experiment with the patched version via qa-regression-
if os.path.
And run:
sudo python3 ./test-apparmor.py -v ApparmorTestsui
The patched apparmor can be found in /tmp, now it can be tested with things like:
cd /tmp/testlibwl2
export USE_SYSTEM=1
make check
== End of update
Output:
LANG=C podchecker -warning -warning *.pod
aa-audit.pod pod syntax OK.
aa-autodep.pod pod syntax OK.
aa-cleanprof.pod pod syntax OK.
aa-complain.pod pod syntax OK.
aa-decode.pod pod syntax OK.
aa-disable.pod pod syntax OK.
aa-easyprof.pod pod syntax OK.
aa-enforce.pod pod syntax OK.
aa-genprof.pod pod syntax OK.
aa-logprof.pod pod syntax OK.
aa-mergeprof.pod pod syntax OK.
aa-notify.pod pod syntax OK.
aa-remove-
aa-sandbox.pod pod syntax OK.
aa-status.pod pod syntax OK.
aa-unconfined.pod pod syntax OK.
logprof.conf.pod pod syntax OK.
aa-notify syntax OK
Checking aa-easyprof
Checking aa-genprof
Checking aa-logprof
Checking aa-cleanprof
Checking aa-mergeprof
Checking aa-autodep
Checking aa-audit
Checking aa-complain
Checking aa-enforce
Checking aa-disable
Checking aa-status
Checking aa-unconfined
Checking apparmor
Checking test/common_test.py
Checking test/minitools_
Checking test/test-
Checking test/test-
Checking test/test-aa.py
Checking test/test-aamode.py
Checking test/test-aare.py
Checking test/test-
Checking test/test-
Checking test/test-
Checking test/test-common.py
Checking test/test-config.py
Checking test/test-dbus.py
Checking test/test-
Checking test/test-file.py
Checking test/test-
Checking test/test-
Checking test/test-
Checking test/test-
Checking test/test-
Checking test/test-
Checking test/test-
Checking test/test-
Checking test/test-ptrace.py
Checking test/test-
Checking test/test-rlimit.py
Checking test/test-
Checking test/test-signal.py
Checking test/test-
Checking test/test-
make[1]: Entering directory '/home/
=== test-example.py ===
.......
-------
Ran 7 tests in 0.000s
OK
.......
-------
Ran 7 tests in 0.000s
OK
=== test-pivot_
Traceback (most recent call last):
File "test-pivot_
import apparmor.aa as aa
ImportError: No module named apparmor.aa
make[1]: *** [Makefile:81: check] Error 1
make[1]: Leaving directory '/home/
make: *** [Makefile:97: check] Error 2
Issue found on B-ibm-gt-5.4, F-oem-5.14, F-aws-fips after we changed how we run the ubuntu_qrt_apparmor test in bug 1982439.
Sub-test in ApparmorTestsui
After some inspection it is because the script is trying to use python2. This can be verified with:
python2 -c "import apparmor.aa"
python3 -c "import apparmor.aa"
This appears to be a known issue.
https:/
And this patch has already landed in apparmor on Jammy, we will need this for Bionic / Focal as well. A temporary workaround is to run:
export PYTHON_
Before starting the tests.
I am not sure why this was not uncovered with "./test-apparmor.py -v" in q-r-t until we run test cases one-by-one now.
tags: | added: ubuntu-qrt-apparmor |
summary: |
- ApparmorTestsuites.test_utils_testsuite from ubuntu_qrt_apparmor failed - with ImportError + test-pivot_root_parse.pyApparmorTestsuites.test_utils_testsuite from + ubuntu_qrt_apparmor failed with ImportError |
summary: |
- test-pivot_root_parse.pyApparmorTestsuites.test_utils_testsuite from - ubuntu_qrt_apparmor failed with ImportError + test-pivot_root_parse.py in apparmor failed with ImportError: No module + named apparmor.aa |
description: | updated |
description: | updated |
Note, Bionic and Focal will likely require more than just that patch. There were multiple patches for Python 3 support landed in apparmor 3. I am not sure what the exact combination required will be.