aboutsummaryrefslogtreecommitdiffstats
path: root/functest/cli/commands/cli_testcase.py
diff options
context:
space:
mode:
authorhelenyao <yaohelan@huawei.com>2016-11-21 06:50:06 -0500
committerjose.lausuch <jose.lausuch@ericsson.com>2016-11-24 15:14:45 +0100
commit3e3c96b2aa15d7757f281ce00518a67e2a1225a9 (patch)
tree9b15e0ceab33a9301ca7cde1a0a36e05f2347584 /functest/cli/commands/cli_testcase.py
parent7a776398ef8b17bd9af5367d712707a903c1c86a (diff)
Extracted all global parameters into functest_constants.py
JIRA: FUNCTEST-533 1. Extracted all global variables into functest_constants.py and updated all affected areas accordingly 2. Used os.path.join to replace '/' to come up with the path for better cross-platform support and improve the path accuracy 3. Removed unused variables 4. Updated the hardcoded path in Dockerfile by using variable reference 5. Removed "/" ending from all path variables 6. Updated the unit test Change-Id: Ib30a81d1f0c83fbaef042d63c187c27bd18301bb Signed-off-by: helenyao <yaohelan@huawei.com>
Diffstat (limited to 'functest/cli/commands/cli_testcase.py')
-rw-r--r--functest/cli/commands/cli_testcase.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/functest/cli/commands/cli_testcase.py b/functest/cli/commands/cli_testcase.py
index da78ae9c..efe177d5 100644
--- a/functest/cli/commands/cli_testcase.py
+++ b/functest/cli/commands/cli_testcase.py
@@ -16,20 +16,16 @@ import click
import functest.ci.tier_builder as tb
import functest.utils.functest_utils as ft_utils
import functest.utils.functest_vacation as vacation
-
-
-FUNCTEST_CONF_DIR = \
- ft_utils.get_functest_config('general.directories.dir_functest_conf')
-ENV_FILE = FUNCTEST_CONF_DIR + "/env_active"
-FUNCTEST_REPO = ft_utils.FUNCTEST_REPO
+import functest.utils.functest_constants as ft_constants
class CliTestcase:
def __init__(self):
- CI_INSTALLER_TYPE = os.getenv('INSTALLER_TYPE')
- CI_SCENARIO = os.getenv('DEPLOY_SCENARIO')
- testcases = ft_utils.get_testcases_file()
+ CI_INSTALLER_TYPE = ft_constants.CI_INSTALLER_TYPE
+ CI_SCENARIO = ft_constants.CI_SCENARIO
+ testcases = ft_constants.FUNCTEST_TESTCASES_YAML
+
self.tiers = tb.TierBuilder(CI_INSTALLER_TYPE, CI_SCENARIO, testcases)
def list(self):
@@ -50,14 +46,14 @@ class CliTestcase:
def run(self, testname, noclean=False):
if testname == 'vacation':
vacation.main()
- elif not os.path.isfile(ENV_FILE):
+ elif not os.path.isfile(ft_constants.ENV_FILE):
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" % (FUNCTEST_REPO, testname))
+ "-n -t %s" % (ft_constants.FUNCTEST_REPO_DIR, testname))
else:
cmd = ("python %s/functest/ci/run_tests.py "
- "-t %s" % (FUNCTEST_REPO, testname))
+ "-t %s" % (ft_constants.FUNCTEST_REPO_DIR, testname))
ft_utils.execute_command(cmd)