From afed983860a4d4aea94db133b4ece9aca6d8a9ce Mon Sep 17 00:00:00 2001 From: Seth Forshee Date: Fri, 16 Feb 2018 08:34:24 -0600 Subject: [PATCH] Pass CONFIG_SECURITY_APPARMOR if either DEFAULT_SECURITY_APPARMOR or SECURITY_APPARMOR_STACKED is enabled --- scripts/test-kernel-security.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/test-kernel-security.py b/scripts/test-kernel-security.py index ebeffe1d7034..a62cc544f1cd 100755 --- a/scripts/test-kernel-security.py +++ b/scripts/test-kernel-security.py @@ -668,12 +668,12 @@ class KernelSecurityTest(testlib.TestlibCase): def test_072_config_security_apparmor(self): '''CONFIG_SECURITY_APPARMOR enabled''' - default_apparmor_option = 'DEFAULT_SECURITY_APPARMOR' - if self.kernel_at_least('4.13'): - default_apparmor_option = 'SECURITY_APPARMOR_STACKED' + opt_security_apparmor = self._get_config('DEFAULT_SECURITY_APPARMOR') + opt_apparmor_stacked = self._get_config('SECURITY_APPARMOR_STACKED') self.assertEqual(self._get_config('SECURITY_APPARMOR'), 'y') - self.assertEqual(self._get_config(default_apparmor_option), 'y') + self.assertTrue(opt_security_apparmor == 'y' or opt_apparmor_stacked == 'y', + 'Neither CONFIG_DEFAULT_SECURITY_APPARMOR nor CONFIG_SECURITY_APPARMOR_STACKED is set') self.assertEqual(self._get_config('SECURITY_APPARMOR_BOOTPARAM_VALUE'), '1') # Hardy and newer -- 2.15.1