From 4ae8dbfdc7d066c7cbb7f5c97a13c3fb3c23300e Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Thu, 3 Nov 2022 01:21:53 +0530 Subject: [PATCH] run.py: allow version tests in shell checks --- run.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/run.py b/run.py index fb449021b..0e3c6733b 100755 --- a/run.py +++ b/run.py @@ -397,13 +397,26 @@ class FileCompareCheck: class ShellCheck: - def __init__(self, config, env): + def __init__(self, config, env, suricata_config): self.config = config self.env = env + self.suricata_config = suricata_config def run(self): + shell_args = {} if not self.config or "args" not in self.config: raise TestError("shell check missing args") + req_version = self.config.get("version") + min_version = self.config.get("min-version") + lt_version = self.config.get("lt-version") + if req_version is not None: + shell_args["version"] = req_version + if min_version is not None: + shell_args["min-version"] = min_version + if lt_version is not None: + shell_args["lt-version"] = lt_version + check_requires(shell_args, self.suricata_config) + try: if WIN32: print("skipping shell check on windows") @@ -732,7 +745,7 @@ class TestRunner: @handle_exceptions def perform_shell_checks(self, check, count, test_num, test_name): - count = ShellCheck(check, self.build_env()).run() + count = ShellCheck(check, self.build_env(), self.suricata_config).run() return count @handle_exceptions -- 2.47.2