From 0d875d44c3d67e049c165365add1084467143b62 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Thu, 15 Dec 2016 16:54:45 +0100 Subject: Add check_criteria() in testcase_base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It allows checking testcase results and then returning an error value to CI. Now run() should return EX_OK even if criteria is FAILED. It also fixes an issue induced by [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/24561/ Change-Id: Iaa095696f9dcb87f8cc95179b4f404b092d1e23e Signed-off-by: Cédric Ollivier --- functest/ci/run_tests.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) mode change 100644 => 100755 functest/ci/run_tests.py (limited to 'functest/ci/run_tests.py') diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py old mode 100644 new mode 100755 index d6991f66b..557ba08dd --- a/functest/ci/run_tests.py +++ b/functest/ci/run_tests.py @@ -141,9 +141,10 @@ def run_test(test, tier_name): cls = getattr(module, run_dict['class']) test_case = cls() result = test_case.run() - if (result == testcase_base.TestcaseBase.EX_OK and - GlobalVariables.REPORT_FLAG): - test_case.push_to_db() + if result == testcase_base.TestcaseBase.EX_OK: + if GlobalVariables.REPORT_FLAG: + test_case.push_to_db() + result = test_case.check_criteria() except ImportError: logger.exception("Cannot import module {}".format( run_dict['module'])) -- cgit 1.2.3-korg