From: jose.lausuch Date: Tue, 12 Jul 2016 15:28:31 +0000 (+0200) Subject: Bugfix run_tests fails to run python scripts X-Git-Tag: colorado.1.0~25 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=b2058a81210e70dbfc3bcf1f5ed9f7cdbc73c62a;p=sdnvpn.git Bugfix run_tests fails to run python scripts Change-Id: Ibd97de79eb8d824120eb2a1b80017ff1f9f99f14 Signed-off-by: jose.lausuch --- diff --git a/test/functest/run_tests.py b/test/functest/run_tests.py index dbe6261..0176161 100644 --- a/test/functest/run_tests.py +++ b/test/functest/run_tests.py @@ -8,10 +8,12 @@ # http://www.apache.org/licenses/LICENSE-2.0 # +import importlib import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as ft_utils import yaml + logger = ft_logger.Logger("sdnvpn").getLogger() with open('config.yaml') as f: @@ -24,8 +26,8 @@ for testcase in testcases: print(title) print("%s\n" % ("=" * len(title))) if testcases[testcase]['type'] == 'python': - filename = testcase + ".py" - filename.main() + t = importlib.import_module(testcase, package=None) + t.main() else: cmd = "bash " + testcase + ".sh" result = ft_utils.execute_command(cmd, logger, exit_on_error=False)