[apparmor] [patch 6/8] parser - use new caching test script
Seth Arnold
seth.arnold at canonical.com
Thu Nov 28 07:47:40 UTC 2013
On Wed, Nov 27, 2013 at 11:40:25PM -0800, Steve Beattie wrote:
> 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>
Hooray for quickly catching the culprit, when it's still easy to spot.
Acked-by: Seth Arnold <seth.arnold at canonical.com>
Thanks!
> ---
> 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)
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20131127/e98b1c89/attachment.pgp>
More information about the AppArmor
mailing list