Comment 3 for bug 1720660

Revision history for this message
John Johansen (jjohansen) wrote :

Fixed in

commit 393d5cca6af1070709f2baaf291d16e27fbea366
Author: John Johansen <email address hidden>
Date: Thu Oct 5 13:50:51 2017 -0700

    Fix test-kernel-security.py when LSM stacking based kernel is used.

    In the LSM stacking kernel DEFAULT_SECURITY_APPARMOR is not set instead
    SECURITY_APPARMOR_STACKED is used to indicate it is part of the default
    stack.

    BugLink: http://bugs.launchpad.net/bugs/1720660
    Signed-off-by: John Johansen <email address hidden>

diff --git a/scripts/test-kernel-security.py b/scripts/test-kernel-security.py
index 2625f9aa..9eecdca5 100755
--- a/scripts/test-kernel-security.py
+++ b/scripts/test-kernel-security.py
@@ -668,7 +668,7 @@ class KernelSecurityTest(testlib.TestlibCase):
         '''CONFIG_SECURITY_APPARMOR enabled'''

         self.assertEqual(self._get_config('SECURITY_APPARMOR'), 'y')
- self.assertEqual(self._get_config('DEFAULT_SECURITY_APPARMOR'), 'y')
+ self.assertTrue(self._get_config('DEFAULT_SECURITY_APPARMOR') == 'y' or self._get_config('CONFIG_SECURITY_APPARMOR_STACKED') == 'y')
         self.assertEqual(self._get_config('SECURITY_APPARMOR_BOOTPARAM_VALUE'), '1')

     # Hardy and newer