diff options
| -rw-r--r-- | lib/oeqa/runtime/cases/apparmor.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/oeqa/runtime/cases/apparmor.py b/lib/oeqa/runtime/cases/apparmor.py index e2cb316..b6a9537 100644 --- a/lib/oeqa/runtime/cases/apparmor.py +++ b/lib/oeqa/runtime/cases/apparmor.py | |||
| @@ -25,3 +25,22 @@ class ApparmorTest(OERuntimeTestCase): | |||
| 25 | msg = ('aa-status failed. ' | 25 | msg = ('aa-status failed. ' |
| 26 | 'Status and output:%s and %s' % (status, output)) | 26 | 'Status and output:%s and %s' % (status, output)) |
| 27 | self.assertEqual(status, 0, msg = msg) | 27 | self.assertEqual(status, 0, msg = msg) |
| 28 | |||
| 29 | @OETestDepends(['apparmor.ApparmorTest.test_apparmor_aa_status']) | ||
| 30 | def test_apparmor_aa_complain(self): | ||
| 31 | status, output = self.target.run('aa-complain /etc/apparmor.d/*') | ||
| 32 | match = re.search('apparmor module is loaded.', output) | ||
| 33 | if not match: | ||
| 34 | msg = ('aa-complain failed. ' | ||
| 35 | 'Status and output:%s and %s' % (status, output)) | ||
| 36 | self.assertEqual(status, 0, msg = msg) | ||
| 37 | |||
| 38 | @OETestDepends(['apparmor.ApparmorTest.test_apparmor_aa_complain']) | ||
| 39 | def test_apparmor_aa_enforce(self): | ||
| 40 | status, output = self.target.run('aa-enforce /etc/apparmor.d/*') | ||
| 41 | match = re.search('apparmor module is loaded.', output) | ||
| 42 | if not match: | ||
| 43 | msg = ('aa-enforce failed. ' | ||
| 44 | 'Status and output:%s and %s' % (status, output)) | ||
| 45 | self.assertEqual(status, 0, msg = msg) | ||
| 46 | |||
