]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
run: Improve 'lt' version checking
authorJeff Lucovsky <jlucovsky@oisf.net>
Fri, 2 Dec 2022 14:27:22 +0000 (09:27 -0500)
committerShivani Bhardwaj <shivanib134@gmail.com>
Mon, 12 Jun 2023 04:53:03 +0000 (10:23 +0530)
This commit improves version checking for the 'less than' case
the Suricata version exceeds the `lt-version` value.

E.g., when Suricata is 7.0.0 and the lt-version specifies 6.0.1

run.py

diff --git a/run.py b/run.py
index 8f8d8ead4fd3dfd03507ce230fa2fa70634e03cd..67d45533a526368c58975f3734b33eb2f607a881 100755 (executable)
--- a/run.py
+++ b/run.py
@@ -256,7 +256,9 @@ class Version:
 
     def is_lt(self, v1, v2):
         """Return True if v1 is less than v2."""
-        if v1.major < v2.major:
+        if v1.major > v2.major:
+            return False
+        elif v1.major < v2.major:
             return True
         elif v1.minor < v2.minor:
             return True