From c3d3203a606dc6cf31c21a21f121651371af65db Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Fri, 25 Dec 2020 19:57:20 +0100 Subject: [PATCH] add re_match_include_parse() test with invalid rule name ... to increase test coverity of regex.py to 100%. --- utils/test/test-regex_matches.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/test/test-regex_matches.py b/utils/test/test-regex_matches.py index b0503b653..dfe25960c 100644 --- a/utils/test/test-regex_matches.py +++ b/utils/test/test-regex_matches.py @@ -594,14 +594,15 @@ class Test_re_match_include_parse_abi(AATest): def _run_test(self, params, expected): self.assertEqual(re_match_include_parse(params, 'abi'), expected) -class Test_re_match_include_parse_empty_filename(AATest): +class Test_re_match_include_parse_errors(AATest): tests = [ - (('include <>', 'include'), AppArmorException), + (('include <>', 'include'), AppArmorException), # various rules with empty filename (('include ""', 'include'), AppArmorException), (('include ', 'include'), AppArmorException), (('abi <>,', 'abi'), AppArmorException), (('abi "",', 'abi'), AppArmorException), (('abi ,', 'abi'), AppArmorException), + (('abi ,', 'invalid'), AppArmorBug), # invalid rule name ] def _run_test(self, params, expected):