From b2058a81210e70dbfc3bcf1f5ed9f7cdbc73c62a Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Tue, 12 Jul 2016 17:28:31 +0200 Subject: Bugfix run_tests fails to run python scripts Change-Id: Ibd97de79eb8d824120eb2a1b80017ff1f9f99f14 Signed-off-by: jose.lausuch --- test/functest/run_tests.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/functest') 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) -- cgit 1.2.3-korg