From 93a1ae5974a398adec18ed5580f3d328f646ed02 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Thu, 2 Feb 2017 09:19:03 +0100 Subject: Define how to pass args to TestcaseBase.run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Here is an exemple of functest/ci/testcases.yaml run: module: 'functest.opnfv_tests.sdn.odl.odl' class: 'ODLTests' args: suites: - /home/opnfv/repos/odl_test/csit/suites/integration/basic - /home/opnfv/repos/odl_test/csit/suites/openstack/neutron Change-Id: I37b0ffa18f626bd8bb52ed460ae38053bd12c8ee Signed-off-by: Cédric Ollivier --- functest/ci/run_tests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py index ef080016..320102dd 100755 --- a/functest/ci/run_tests.py +++ b/functest/ci/run_tests.py @@ -148,7 +148,11 @@ 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.publish_report() -- cgit 1.2.3-korg