diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2016-12-15 16:54:45 +0100 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2016-12-15 18:24:38 +0100 |
commit | 0d875d44c3d67e049c165365add1084467143b62 (patch) | |
tree | eb5cb1bab09f90e9196371c2aa446a11ef085610 /functest/ci/run_tests.py | |
parent | 41ccc6e8a54f11e0014707730bf3ef80385a01fa (diff) |
Add check_criteria() in testcase_base
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 <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/ci/run_tests.py')
-rwxr-xr-x[-rw-r--r--] | functest/ci/run_tests.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py index d6991f66..557ba08d 100644..100755 --- 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'])) |