From: Markus Kullberg Date: Fri, 29 Jul 2016 08:06:29 +0000 (+0300) Subject: Return -1 in Rally if the success criteria is not met X-Git-Tag: colorado.1.0~189 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F89%2F17789%2F5;p=functest.git Return -1 in Rally if the success criteria is not met JIRA: FUNCTEST-382 Change-Id: Iaf475ecd3dbfcf6fb639ff146fe96e54c5393a1e Signed-off-by: Markus Kullberg --- diff --git a/testcases/OpenStack/rally/run_rally-cert.py b/testcases/OpenStack/rally/run_rally-cert.py index 2bb191fad..1f1214e03 100755 --- a/testcases/OpenStack/rally/run_rally-cert.py +++ b/testcases/OpenStack/rally/run_rally-cert.py @@ -512,6 +512,10 @@ def main(): # Evaluation of the success criteria status = functest_utils.check_success_rate(case_name, success_rate) + exit_code = -1 + if status == "PASS": + exit_code = 0 + if args.report: logger.debug("Pushing Rally summary into DB...") functest_utils.push_results_to_db("functest", @@ -522,7 +526,7 @@ def main(): status, payload) if args.noclean: - exit(0) + exit(exit_code) if not image_exists: logger.debug("Deleting image '%s' with ID '%s'..." @@ -536,6 +540,8 @@ def main(): if not os_utils.delete_volume_type(cinder_client, volume_type): logger.error("Error in deleting volume type...") + exit(exit_code) + if __name__ == '__main__': main()