]> git.proxmox.com Git - systemd.git/commitdiff
debian/tests/boot-and-services: Skip AppArmor test if AppArmor is not enabled
authorMartin Pitt <martin.pitt@ubuntu.com>
Mon, 23 Feb 2015 06:49:25 +0000 (07:49 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Mon, 23 Feb 2015 06:49:25 +0000 (07:49 +0100)
debian/changelog
debian/tests/boot-and-services

index c8085d9355d839487c2f3dd42dc90764b583aec3..24c25c136423dfd7a8c0a34413f4989f5e587a6b 100644 (file)
@@ -17,6 +17,8 @@ systemd (219-3) UNRELEASED; urgency=medium
     minimal unconfigured testbed.
   * Add missing python3 test dependency to cmdline-upstart-boot and
     display-managers autopkgtests.
+  * debian/tests/boot-and-services: Skip AppArmor test if AppArmor is not
+    enabled.
 
  -- Martin Pitt <mpitt@debian.org>  Thu, 19 Feb 2015 11:13:26 +0100
 
index 1021dd531d25a8677c4535c86ce1b06b3557c7c6..f926177e6b1677b2820a482f9b295e54ef2df961 100755 (executable)
@@ -30,6 +30,9 @@ class ServicesTest(unittest.TestCase):
         # FIXME: ignore /etc/modules failure as stuff that we put there by
         # default often fails
         failed = [f for f in failed if 'systemd-modules-load' not in f]
+        # apparmor fails if not enabled in the kernel
+        if not os.path.exists('/sys/kernel/security/apparmor'):
+            failed = [f for f in failed if 'apparmor.service' not in f]
         self.assertEqual(failed, [])
 
     def test_lightdm(self):
@@ -172,6 +175,8 @@ poweroff\n''')
         self.assertIn(b'Requesting system poweroff', out)
 
 
+@unittest.skipUnless(os.path.exists('/sys/kernel/security/apparmor'),
+                     'AppArmor not enabled')
 class AppArmorTest(unittest.TestCase):
     def test_profile(self):
         '''AppArmor confined unit'''