Return -1 in Rally if the success criteria is not met 89/17789/5
authorMarkus Kullberg <markus.kullberg@nokia.com>
Fri, 29 Jul 2016 08:06:29 +0000 (11:06 +0300)
committerJose Lausuch <jose.lausuch@ericsson.com>
Fri, 29 Jul 2016 11:09:57 +0000 (11:09 +0000)
JIRA: FUNCTEST-382

Change-Id: Iaf475ecd3dbfcf6fb639ff146fe96e54c5393a1e
Signed-off-by: Markus Kullberg <markus.kullberg@nokia.com>
testcases/OpenStack/rally/run_rally-cert.py

index 2bb191f..1f1214e 100755 (executable)
@@ -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()