From: Shivani Bhardwaj Date: Wed, 14 Jun 2023 12:27:08 +0000 (+0530) Subject: run.py: allow matches on substrings in yaml X-Git-Tag: suricata-6.0.13~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19c720b845018e851ad5c164fec2d80ef23a3c74;p=thirdparty%2Fsuricata-verify.git run.py: allow matches on substrings in yaml --- diff --git a/run.py b/run.py index 8e2f1acee..6c69623bc 100755 --- a/run.py +++ b/run.py @@ -390,7 +390,10 @@ def find_value(name, obj): return len(obj) except: return -1 - + if part == "__find": + # Return full obj on __find and do a substring find in caller + # where the expected is also available + break name = None index = None m = re.match("^(.*)\[(\d+)\]$", part) @@ -560,6 +563,9 @@ class FilterCheck: else: val = find_value(key, event) if val != expected: + if key.endswith("__find"): + if val.find(expected) != -1: + return True if str(val) == str(expected): print("Different types but same string", type(val), val, type(expected), expected) return False