From: Tharushi Jayasekara Date: Wed, 24 Feb 2021 16:53:25 +0000 (+0530) Subject: run.py: integrate check-eve.py X-Git-Tag: suricata-6.0.4~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e49c17618e81ebe2c94c7906a081374b885fd71;p=thirdparty%2Fsuricata-verify.git run.py: integrate check-eve.py --- diff --git a/run.py b/run.py index a6739b089..6024de9dd 100755 --- a/run.py +++ b/run.py @@ -41,6 +41,7 @@ import multiprocessing as mp from collections import namedtuple import threading import filecmp +import subprocess import yaml WIN32 = sys.platform == "win32" @@ -568,7 +569,7 @@ class TestRunner: glob.glob(os.path.join(self.directory, "*.pcapng")): raise UnsatisfiedRequirementError("No pcap file found") - def run(self): + def run(self, outdir): if not self.force: self.check_requires() @@ -648,6 +649,10 @@ class TestRunner: r, expected_exit_code)); check_value = self.check() + + check_output = subprocess.call(["{}/check-eve.py".format(TOPDIR), outdir, "-q"]) + if check_output != 0: + raise TestError("Invalid JSON schema") if not check_value["failure"] and not check_value["skipped"]: if not self.quiet: @@ -842,7 +847,7 @@ def run_test(dirpath, args, cwd, suricata_config): cwd, dirpath, outdir, suricata_config, args.verbose, args.force, args.quiet) try: - results = test_runner.run() + results = test_runner.run(outdir) if results["failure"] > 0: with lock: count_dict["failed"] += 1 @@ -852,7 +857,7 @@ def run_test(dirpath, args, cwd, suricata_config): count_dict["skipped"] += 1 elif results["success"] > 0: with lock: - count_dict["passed"] += 1 + count_dict["passed"] += 1 except UnsatisfiedRequirementError as ue: if not args.quiet: print("===> {}: SKIPPED: {}".format(os.path.basename(dirpath), ue))