Merge "Add flavor creation in functest env prepare"
[functest.git] / functest / ci / run_tests.py
index 722929d..320102d 100755 (executable)
@@ -93,10 +93,6 @@ def source_rc_file():
             elif key == 'OS_PASSWORD':
                 ft_constants.OS_PASSWORD = value
                 CONST.OS_PASSWORD = value
-    logger.debug("OS_AUTH_URL:%s" % CONST.OS_AUTH_URL)
-    logger.debug("OS_USERNAME:%s" % CONST.OS_USERNAME)
-    logger.debug("OS_TENANT_NAME:%s" % CONST.OS_TENANT_NAME)
-    logger.debug("OS_PASSWORD:%s" % CONST.OS_PASSWORD)
 
 
 def generate_os_snapshot():
@@ -152,10 +148,14 @@ def run_test(test, tier_name, testcases=None):
             module = importlib.import_module(run_dict['module'])
             cls = getattr(module, run_dict['class'])
             test_case = cls()
-            result = test_case.run()
+            try:
+                kwargs = run_dict['args']
+                result = test_case.run(**kwargs)
+            except KeyError:
+                result = test_case.run()
             if result == testcase_base.TestcaseBase.EX_OK:
                 if GlobalVariables.REPORT_FLAG:
-                    test_case.push_to_db()
+                    test_case.publish_report()
                 result = test_case.check_criteria()
         except ImportError:
             logger.exception("Cannot import module {}".format(
@@ -179,7 +179,7 @@ def run_test(test, tier_name, testcases=None):
 
     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():
@@ -189,8 +189,9 @@ def run_test(test, tier_name, testcases=None):
                 # 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)