From ada85bf219dfd0cc69fcc8a5083cf6ff8d770d98 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Fri, 26 Jun 2015 23:21:29 +0200 Subject: [PATCH] Add more set_profile_flags() tests The existing tests didn't test removing all flags. Acked-by: Steve Beattie --- utils/test/test-aa.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/test/test-aa.py b/utils/test/test-aa.py index 20b012105..57a23d4b7 100644 --- a/utils/test/test-aa.py +++ b/utils/test/test-aa.py @@ -181,6 +181,8 @@ class AaTest_set_profile_flags(AaTestWithTempdir): self._test_set_flags('profile "/foo bar"', 'flags=(complain)', 'audit', profile_name='/foo bar') def test_set_flags_12(self): self._test_set_flags('profile xy "/foo bar"', 'flags=(complain)', 'audit', profile_name='xy') + def test_set_flags_13(self): + self._test_set_flags('/foo', '(audit)', '') # test handling of hat flags def test_set_flags_with_hat_01(self): @@ -208,6 +210,12 @@ class AaTest_set_profile_flags(AaTestWithTempdir): expected_more_rules='\n hat foobar flags=(audit) { # comment\n}\n' ) + def test_set_flags_with_hat_05(self): + self._test_set_flags('/foo', '(audit)', '', + more_rules='\n hat foobar (attach_disconnected) { # comment\n}\n', # XXX attach_disconnected will be lost! + expected_more_rules='\n hat foobar { # comment\n}\n' + ) + # test handling of child profiles def test_set_flags_with_child_01(self): self._test_set_flags('/foo', 'flags=(complain)', 'audit',