From: Jason Ish Date: Thu, 18 Jan 2018 15:23:18 +0000 (-0600) Subject: test.yaml: allow expected exit code to be set X-Git-Tag: suricata-6.0.4~521 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1138b731dbf2f9f4452b49b54f7923c01a815d25;p=thirdparty%2Fsuricata-verify.git test.yaml: allow expected exit code to be set --- diff --git a/run.py b/run.py index 90ad96ea6..6b75897a5 100755 --- a/run.py +++ b/run.py @@ -320,6 +320,11 @@ class TestRunner: else: count = 1 + if "exit-code" in self.config: + expected_exit_code = self.config["exit-code"] + else: + expected_exit_code = 0 + for _ in range(count): # Cleanup the output directory. @@ -346,9 +351,9 @@ class TestRunner: r = p.wait() - if r != 0: - print("FAIL: process returned with non-0 exit code: %d" % r) - return False + if r != expected_exit_code: + raise TestError("got exit code %d, expected %d" % ( + r, expected_exit_code)); if not self.check(): return False