]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
runner: convert runtime exceptions to TestError 646/head
authorJason Ish <jason.ish@oisf.net>
Thu, 6 Jan 2022 17:09:35 +0000 (11:09 -0600)
committerJason Ish <jason.ish@oisf.net>
Fri, 14 Jan 2022 20:57:15 +0000 (14:57 -0600)
Convert exceptions from code errors (well, any unexpected exception)
into a TestError. This allows the test to be reported as failed.

I think because tests are run in separate processes, its harder to
catch these sorts of errors.

run.py

diff --git a/run.py b/run.py
index d5440343d46d2e48d49159b1e7cbe47925fc53e2..91f628cd608bd07c27fca879ef677e417f04e4de 100755 (executable)
--- a/run.py
+++ b/run.py
@@ -163,6 +163,8 @@ def handle_exceptions(func):
             if args and not args[0].quiet:
                 print("===> {}: Sub test #{}: SKIPPED : {}".format(kwargs["test_name"], kwargs["test_num"], ue))
             kwargs["count"]["skipped"] += 1
+        except Exception as err:
+            raise TestError("Internal runtime error: {}".format(err))
         else:
             if result:
               kwargs["count"]["success"] += 1