2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-28 21:07:56 +00:00

Add more set_profile_flags() tests

The existing tests didn't test removing all flags.


Acked-by: Steve Beattie <steve@nxnw.org>
This commit is contained in:
Christian Boltz 2015-06-26 23:21:29 +02:00
parent 1b670fef6c
commit ada85bf219

View File

@ -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',