mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
parser: fix python caching test in envs without apparmor securityfs mounted
Enabling the python caching test by default broke the build tests when running in environments that do not contain the apparmor securityfs mounted (think build chroots). This is because an initial check from the shell script version of the tests was not reproduced within the python version. This patch adds a check in the base class setUp function that marks each testcase as skipped if apparmor's securityfs cannot be found. Signed-off-by: Steve Beattie <steve@nxnw.org> Acked-by: Seth Arnold <seth.arnold@canonical.com>
This commit is contained in:
parent
cfd8478ba4
commit
fb33689ec3
1 changed files with 5 additions and 0 deletions
|
@ -51,6 +51,11 @@ class AAParserCachingCommon(testlib.AATestTemplate):
|
|||
# REPORT ALL THE OUTPUT
|
||||
self.maxDiff = None
|
||||
|
||||
# skip all the things if apparmor securityfs isn't mounted
|
||||
if not os.path.exists("/sys/kernel/security/apparmor"):
|
||||
raise unittest.SkipTest("WARNING: /sys/kernel/security/apparmor does not exist. "
|
||||
"Skipping tests")
|
||||
|
||||
self.tmp_dir = tempfile.mkdtemp(prefix='aa-caching-')
|
||||
os.chmod(self.tmp_dir, 0o755)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue