]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
run.py: add option to check for architecture
authorShivani Bhardwaj <shivanib134@gmail.com>
Fri, 28 Jun 2024 06:31:40 +0000 (12:01 +0530)
committerVictor Julien <victor@inliniac.net>
Thu, 4 Jul 2024 04:37:22 +0000 (06:37 +0200)
README.md
run.py

index 20ddb609ec4aba293f02a0eb8346ed011284b452..bc10c6a8f4ee1373f435d9313ebfc66f2ed4c8c8 100644 (file)
--- a/README.md
+++ b/README.md
@@ -59,6 +59,10 @@ requires:
   # a test run only on Linux.
   os: linux
 
+  # Test is only for the liste architecture. For example, following would
+  # make a test run only on x86_64. Other values can be amd64, i386, etc.
+  arch: x86_64
+
   # Require the presence of specific features.
   features:
     # Restrict the test to builds with HAVE_LUA.
diff --git a/run.py b/run.py
index b9a3f1c9929bc0add42fea6d553cb9aa05cef710..478bcce5459b04cd90fe07f9b1095e6f68066eb1 100755 (executable)
--- a/run.py
+++ b/run.py
@@ -373,6 +373,10 @@ def check_requires(requires, suricata_config: SuricataConfig):
             cur_platform = platform.system().lower()
             if not cur_platform.startswith(requires["os"].lower()):
                 raise UnsatisfiedRequirementError(requires["os"])
+        elif key == "arch":
+            cur_arch = platform.machine().lower()
+            if not cur_arch.startswith(requires["arch"].lower()):
+                raise UnsatisfiedRequirementError(requires["arch"])
         else:
             raise Exception("unknown requires types: %s" % (key))