[apparmor] [patch 6/8] parser - use new caching test script

Steve Beattie steve at nxnw.org
Thu Nov 28 07:40:25 UTC 2013


On Wed, Nov 27, 2013 at 06:01:18PM -0800, Seth Arnold wrote:
> On Wed, Oct 23, 2013 at 06:41:50PM -0700, Steve Beattie wrote:
> > This patch:
> >  - incorporates the new python caching test into the make check/make
> >    caching target, and removes the older shell based test script
> >  - adjusts the python scripts to give verbose output when the VERBOSE
> >    flag is set
> >  - reorders the tests so that the tests that take a shorter amount of
> >    time to run come first, leaving the language sanity test with its
> >    69000+ testcases last
> >  - moves the make dependency for the auto-generation of the sanity tests
> >    into the parser_sanity/valgrind targets and out of the main tests target
> > 
> > Patch history:
> >   v1: initial revision
> >   v2: add gen_xtrans/gen_dbus dependency to valgrind test
> > 
> > Acked-by: Steve Beattie <steve at nxnw.org>
> > ---
> >  parser/tst/Makefile   |   11 +--
> >  parser/tst/caching.sh |  173 --------------------------------------------------
> >  2 files changed, 6 insertions(+), 178 deletions(-)
> 
> I think I'd have liked to see the caching.py added also in this patch, it
> seems odd to ACK a patch that removes so much but doesn't put anything
> back... slight whinging aside :)

Yeah, I regret not having it all have been one patch; however...

> Acked-by: Seth Arnold <seth.arnold at canonical.com>

Having committed this patch, I discovered that I broke the build
in places where the apparmor securityfs is not mounted (think build
chroots), because I hadn't reproduced the test skipping code that the
shell script had in that situation. So here's a patch that skips the
testcases when the apparmor filesystem can't be found. Sigh.

Signed-off-by: Steve Beattie <steve at nxnw.org>
---
 parser/tst/caching.py |    5 +++++
 1 file changed, 5 insertions(+)

Index: b/parser/tst/caching.py
===================================================================
--- a/parser/tst/caching.py
+++ b/parser/tst/caching.py
@@ -51,6 +51,11 @@ class AAParserCachingCommon(testlib.AATe
         # 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)
 

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20131127/cdeaf365/attachment.pgp>


More information about the AppArmor mailing list