From: Shivani Bhardwaj Date: Tue, 11 Jun 2024 10:08:21 +0000 (+0530) Subject: run.py: add option to check for os X-Git-Tag: suricata-7.0.7~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=435c06997cf5f4f893e48082839de3d711458815;p=thirdparty%2Fsuricata-verify.git run.py: add option to check for os --- diff --git a/README.md b/README.md index 9760eb9e9..20ddb609e 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,10 @@ requires: # release, but 4.0.3 would only match 4.0.3. version: 4.0 + # Test is only for the listed OS. For example, the following would make + # a test run only on Linux. + os: linux + # Require the presence of specific features. features: # Restrict the test to builds with HAVE_LUA. diff --git a/run.py b/run.py index 6b45f10fc..b9a3f1c99 100755 --- a/run.py +++ b/run.py @@ -44,6 +44,7 @@ import filecmp import subprocess import yaml import traceback +import platform VALIDATE_EVE = False WIN32 = sys.platform == "win32" @@ -368,6 +369,10 @@ def check_requires(requires, suricata_config: SuricataConfig): elif key == "lambda": if not eval(requires["lambda"]): raise UnsatisfiedRequirementError(requires["lambda"]) + elif key == "os": + cur_platform = platform.system().lower() + if not cur_platform.startswith(requires["os"].lower()): + raise UnsatisfiedRequirementError(requires["os"]) else: raise Exception("unknown requires types: %s" % (key))