Skip to contentSkip to conversation

apparmor: add a few more runtime

PATCH New Armin Kuster 1 participant 1 message May 4, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 apparmor: add a few more runtime

---
 lib/oeqa/runtime/cases/apparmor.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
lib/oeqa/runtime/cases/apparmor.py +19 -0
index e2cb316..b6a9537 100644
@@ -25,3 +25,22 @@ class ApparmorTest(OERuntimeTestCase):
             msg = ('aa-status  failed. '
                'Status and output:%s and %s' % (status, output))
             self.assertEqual(status, 0, msg = msg)
+
+    @OETestDepends(['apparmor.ApparmorTest.test_apparmor_aa_status'])
+    def test_apparmor_aa_complain(self):
+        status, output = self.target.run('aa-complain /etc/apparmor.d/*')
+        match = re.search('apparmor module is loaded.', output)
+        if not match:
+            msg = ('aa-complain  failed. '
+               'Status and output:%s and %s' % (status, output))
+            self.assertEqual(status, 0, msg = msg)
+
+    @OETestDepends(['apparmor.ApparmorTest.test_apparmor_aa_complain'])
+    def test_apparmor_aa_enforce(self):
+        status, output = self.target.run('aa-enforce /etc/apparmor.d/*')
+        match = re.search('apparmor module is loaded.', output)
+        if not match:
+            msg = ('aa-enforce  failed. '
+               'Status and output:%s and %s' % (status, output))
+            self.assertEqual(status, 0, msg = msg)
+
Signature · 1 line
2.17.1