Bugfix: fix the wrong return code
authorhelenyao <yaohelan@huawei.com>
Thu, 12 Jan 2017 11:12:04 +0000 (06:12 -0500)
committerhelenyao <yaohelan@huawei.com>
Thu, 12 Jan 2017 11:16:34 +0000 (06:16 -0500)
The bug was introduced by patch[1]
[1] https://gerrit.opnfv.org/gerrit/#/c/24619/

Change-Id: Icf6c267aba26fcb5b129a611423dcf2200f95277
Signed-off-by: helenyao <yaohelan@huawei.com>
functest/ci/run_tests.py

index 7aac9d2..35345fe 100755 (executable)
@@ -170,7 +170,7 @@ def run_test(test, tier_name):
 
     if result != 0:
         logger.error("The test case '%s' failed. " % test_name)
-        OVERALL_RESULT = -1
+        GlobalVariables.OVERALL_RESULT = -1
         result_str = "FAIL"
 
         if test.is_blocking():
@@ -180,8 +180,9 @@ def run_test(test, tier_name):
                 # if it is a single test we don't print the whole results table
                 update_test_info(test_name, result_str, duration_str)
                 generate_report.main(GlobalVariables.EXECUTED_TEST_CASES)
-            logger.info("Execution exit value: %s" % OVERALL_RESULT)
-            sys.exit(OVERALL_RESULT)
+            logger.info("Execution exit value: %s" %
+                        GlobalVariables.OVERALL_RESULT)
+            sys.exit(GlobalVariables.OVERALL_RESULT)
 
     update_test_info(test_name, result_str, duration_str)