]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
run: Improved support of shell tests
authorJeff Lucovsky <jeff@lucovsky.org>
Wed, 19 Feb 2020 14:21:17 +0000 (09:21 -0500)
committerJason Ish <jason.ish@oisf.net>
Fri, 20 Mar 2020 21:48:31 +0000 (15:48 -0600)
run.py
tests/pcre-invalid-rule-01/.test.rules.swp [deleted file]
tests/pcre-invalid-rule-01/.test.yaml.swp [deleted file]

diff --git a/run.py b/run.py
index bbfd269ec0e6244e712f19ea4f8b8955ef288c91..24951fbafb76ef8e74f5ea0b4f273549899d8b6e 100755 (executable)
--- a/run.py
+++ b/run.py
@@ -118,8 +118,9 @@ def pipe_reader(fileobj, output=None, verbose=False):
 
 def handle_exceptions(func):
     def applicator(*args, **kwargs):
+        result = False
         try:
-            func(*args,**kwargs)
+            result = func(*args,**kwargs)
         except TestError as te:
             print("Sub test #{}: FAIL : {}".format(kwargs["test_num"], te))
             check_args_fail()
@@ -128,7 +129,11 @@ def handle_exceptions(func):
             print("Sub test #{}: SKIPPED : {}".format(kwargs["test_num"], ue))
             kwargs["count"]["skipped"] += 1
         else:
-            kwargs["count"]["success"] += 1
+            if result:
+              kwargs["count"]["success"] += 1
+            else:
+              print("\nSub test #{}: FAIL : {}".format(kwargs["test_num"], kwargs["check"]["args"]))
+              kwargs["count"]["failure"] += 1
         return kwargs["count"]
     return applicator
 
diff --git a/tests/pcre-invalid-rule-01/.test.rules.swp b/tests/pcre-invalid-rule-01/.test.rules.swp
deleted file mode 100644 (file)
index 6258592..0000000
Binary files a/tests/pcre-invalid-rule-01/.test.rules.swp and /dev/null differ
diff --git a/tests/pcre-invalid-rule-01/.test.yaml.swp b/tests/pcre-invalid-rule-01/.test.yaml.swp
deleted file mode 100644 (file)
index e9f6515..0000000
Binary files a/tests/pcre-invalid-rule-01/.test.yaml.swp and /dev/null differ