From fb33689ec3696bbd2ce39f88ebe9699eea97ba64 Mon Sep 17 00:00:00 2001 From: Steve Beattie Date: Wed, 27 Nov 2013 23:54:09 -0800 Subject: [PATCH] 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 Acked-by: Seth Arnold --- parser/tst/caching.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/parser/tst/caching.py b/parser/tst/caching.py index 30ed05140..a613e9bdf 100755 --- a/parser/tst/caching.py +++ b/parser/tst/caching.py @@ -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)