mirror of
https://github.com/falcosecurity/falco.git
synced 2025-10-22 12:27:10 +00:00
Tests for rule name matching using patterns
Modify the disabled_rules_using_regex test to disabled_rules_using_substring with an appropriate substring. Also add a test where rule names have regex chars and allow rule names to have regex chars when parsing falco's output in tests. These changes are future-looking in case we want to add back support for rule enabling/disabling using regexes. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
This commit is contained in:
committed by
Leo Di Donato
parent
3fedd00cfc
commit
a42ec9d7c7
@@ -269,7 +269,7 @@ class FalcoTest(Test):
|
||||
triggered_rules = match.group(1)
|
||||
|
||||
for rule, count in self.detect_counts.iteritems():
|
||||
expected = '\s{}: (\d+)'.format(rule)
|
||||
expected = '\s{}: (\d+)'.format(re.sub(r'([$\.*+?()[\]{}|^])', r'\\\1', rule))
|
||||
match = re.search(expected, triggered_rules)
|
||||
|
||||
if match is None:
|
||||
|
Reference in New Issue
Block a user