mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-05 08:45:22 +00:00
extend add_or_remove_flag() to handle str for old flags
If the old flags are given as str (or None), call split_flags() to convert them to a list. This allows to simplify change_profile_flags() which now doesn't need to call split_flags() on its own. Also add some tests with a str for the old flags
This commit is contained in:
@@ -46,6 +46,10 @@ class AaTest_add_or_remove_flag(AATest):
|
||||
([ [], 'audit', False ], [] ),
|
||||
([ ['complain'], 'audit', True ], ['audit', 'complain'] ),
|
||||
([ ['complain'], 'audit', False ], ['complain'] ),
|
||||
([ '', 'audit', True ], ['audit'] ),
|
||||
([ None, 'audit', False ], [] ),
|
||||
([ 'complain', 'audit', True ], ['audit', 'complain'] ),
|
||||
([ ' complain ', 'audit', False ], ['complain'] ),
|
||||
]
|
||||
|
||||
def _run_test(self, params, expected):
|
||||
|
Reference in New Issue
Block a user