From: jose.lausuch Date: Mon, 19 Dec 2016 13:06:27 +0000 (+0100) Subject: Allow executing several testcases with the CLI X-Git-Tag: danube.1.RC1~237 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F43%2F26243%2F1;p=functest.git Allow executing several testcases with the CLI By naming the test cases separated by "," The CLI will call run_tests.py for each test case. This is needed for example for the 3rd party CI. Change-Id: I2fa5c68ebb292b462153853879630c0cbc5ef0a2 Signed-off-by: jose.lausuch --- diff --git a/functest/cli/commands/cli_testcase.py b/functest/cli/commands/cli_testcase.py index efe177d52..70a77a142 100644 --- a/functest/cli/commands/cli_testcase.py +++ b/functest/cli/commands/cli_testcase.py @@ -50,10 +50,12 @@ class CliTestcase: click.echo("Functest environment is not ready. " "Run first 'functest env prepare'") else: - if noclean: - cmd = ("python %s/functest/ci/run_tests.py " - "-n -t %s" % (ft_constants.FUNCTEST_REPO_DIR, testname)) - else: - cmd = ("python %s/functest/ci/run_tests.py " - "-t %s" % (ft_constants.FUNCTEST_REPO_DIR, testname)) - ft_utils.execute_command(cmd) + tests = testname.split(",") + for test in tests: + if noclean: + cmd = ("python %s/functest/ci/run_tests.py " + "-n -t %s" % (ft_constants.FUNCTEST_REPO_DIR, test)) + else: + cmd = ("python %s/functest/ci/run_tests.py " + "-t %s" % (ft_constants.FUNCTEST_REPO_DIR, test)) + ft_utils.execute_command(cmd)