unify testcases.yaml obtain process
[functest.git] / ci / run_tests.py
index 758a87c..d8f4883 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python -u
 #
 # Author: Jose Lausuch (jose.lausuch@ericsson.com)
 #
@@ -13,8 +13,10 @@ import datetime
 import os
 import re
 import sys
+
 import functest.ci.generate_report as generate_report
 import functest.ci.tier_builder as tb
+from functest.testcases.Controllers.ODL.OpenDaylightTesting import ODLTestCases
 import functest.utils.functest_logger as ft_logger
 import functest.utils.functest_utils as ft_utils
 import functest.utils.openstack_clean as os_clean
@@ -100,9 +102,15 @@ def run_test(test, tier_name):
     if REPORT_FLAG:
         flags += " -r"
 
-    cmd = ("%s%s" % (EXEC_SCRIPT, flags))
-    logger.debug("Executing command '%s'" % cmd)
-    result = ft_utils.execute_command(cmd, logger, exit_on_error=False)
+    if test_name == 'odl':
+        result = ODLTestCases.functest_run()
+        if result and REPORT_FLAG:
+            result = ODLTestCases.push_to_db()
+        result = not result
+    else:
+        cmd = ("%s%s" % (EXEC_SCRIPT, flags))
+        logger.debug("Executing command '%s'" % cmd)
+        result = ft_utils.execute_command(cmd, exit_on_error=False)
 
     if CLEAN_FLAG:
         cleanup()
@@ -179,7 +187,7 @@ def main():
     CI_INSTALLER_TYPE = os.getenv('INSTALLER_TYPE')
     CI_SCENARIO = os.getenv('DEPLOY_SCENARIO')
 
-    file = FUNCTEST_REPO + "/ci/testcases.yaml"
+    file = ft_utils.get_testcases_file()
     _tiers = tb.TierBuilder(CI_INSTALLER_TYPE, CI_SCENARIO, file)
 
     if args.noclean: