mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 06:16:03 +00:00
add_or_remove_flag(): allow to add or remove multiple flags
Multiple flags can be given as string (will be split) or as array. Also add some tests confirming that everything works as expected.
This commit is contained in:
@@ -50,6 +50,14 @@ class AaTest_add_or_remove_flag(AATest):
|
||||
([ None, 'audit', False ], [] ),
|
||||
([ 'complain', 'audit', True ], ['audit', 'complain'] ),
|
||||
([ ' complain ', 'audit', False ], ['complain'] ),
|
||||
([ 'audit complain', ['audit', 'complain'], False ], [] ),
|
||||
([ 'audit complain', 'audit complain', False ], [] ),
|
||||
([ 'audit complain', ['audit', 'enforce'], False ], ['complain'] ),
|
||||
([ 'audit complain', 'audit enforce', False ], ['complain'] ),
|
||||
([ '', ['audit', 'complain'], True ], ['audit', 'complain'] ),
|
||||
([ '', 'audit complain', True ], ['audit', 'complain'] ),
|
||||
([ 'audit', ['audit', 'enforce'], True ], ['audit', 'enforce'] ),
|
||||
([ 'audit', 'audit enforce', True ], ['audit', 'enforce'] ),
|
||||
]
|
||||
|
||||
def _run_test(self, params, expected):
|
||||
|
Reference in New Issue
Block a user