mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-29 13:28:19 +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:
parent
1b670fef6c
commit
ada85bf219
@ -181,6 +181,8 @@ class AaTest_set_profile_flags(AaTestWithTempdir):
|
|||||||
self._test_set_flags('profile "/foo bar"', 'flags=(complain)', 'audit', profile_name='/foo bar')
|
self._test_set_flags('profile "/foo bar"', 'flags=(complain)', 'audit', profile_name='/foo bar')
|
||||||
def test_set_flags_12(self):
|
def test_set_flags_12(self):
|
||||||
self._test_set_flags('profile xy "/foo bar"', 'flags=(complain)', 'audit', profile_name='xy')
|
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
|
# test handling of hat flags
|
||||||
def test_set_flags_with_hat_01(self):
|
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'
|
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
|
# test handling of child profiles
|
||||||
def test_set_flags_with_child_01(self):
|
def test_set_flags_with_child_01(self):
|
||||||
self._test_set_flags('/foo', 'flags=(complain)', 'audit',
|
self._test_set_flags('/foo', 'flags=(complain)', 'audit',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user