aboutsummaryrefslogtreecommitdiffstats
path: root/functest/cli/commands
diff options
context:
space:
mode:
Diffstat (limited to 'functest/cli/commands')
-rw-r--r--functest/cli/commands/cli_env.py16
-rw-r--r--functest/cli/commands/cli_os.py6
-rw-r--r--functest/cli/commands/cli_testcase.py9
-rw-r--r--functest/cli/commands/cli_tier.py9
4 files changed, 15 insertions, 25 deletions
diff --git a/functest/cli/commands/cli_env.py b/functest/cli/commands/cli_env.py
index b43116fc..ce977572 100644
--- a/functest/cli/commands/cli_env.py
+++ b/functest/cli/commands/cli_env.py
@@ -8,9 +8,9 @@
#
import os
+import pkg_resources
import click
-import git
import prettytable
from functest.utils.constants import CONST
@@ -36,8 +36,8 @@ class CliEnv(object):
else:
answer = raw_input("Invalid answer. Please type [y|n]\n")
- cmd = ("python %s/functest/ci/prepare_env.py start" %
- CONST.__getattribute__('dir_repo_functest'))
+ cmd = ("python %s start" % pkg_resources.resource_filename(
+ 'functest', 'ci/prepare_env.py'))
ft_utils.execute_command(cmd)
def show(self):
@@ -49,14 +49,6 @@ class CliEnv(object):
installer_info = ("%s, %s" % (install_type, installer_ip))
scenario = _get_value(CONST.__getattribute__('DEPLOY_SCENARIO'))
node = _get_value(CONST.__getattribute__('NODE_NAME'))
- repo_h = git.Repo(CONST.__getattribute__('dir_repo_functest')).head
- if repo_h.is_detached:
- git_branch = 'detached from FETCH_HEAD'
- git_hash = repo_h.commit.hexsha
- else:
- branch = repo_h.reference
- git_branch = branch.name
- git_hash = branch.commit.hexsha
is_debug = _get_value(CONST.__getattribute__('CI_DEBUG'), 'false')
build_tag = CONST.__getattribute__('BUILD_TAG')
if build_tag is not None:
@@ -73,8 +65,6 @@ class CliEnv(object):
msg.add_row(['INSTALLER', installer_info])
msg.add_row(['SCENARIO', scenario])
msg.add_row(['POD', node])
- msg.add_row(['GIT BRANCH', git_branch])
- msg.add_row(['GIT HASH', git_hash])
if build_tag:
msg.add_row(['BUILD TAG', build_tag])
msg.add_row(['DEBUG FLAG', is_debug])
diff --git a/functest/cli/commands/cli_os.py b/functest/cli/commands/cli_os.py
index c66362fc..875529f2 100644
--- a/functest/cli/commands/cli_os.py
+++ b/functest/cli/commands/cli_os.py
@@ -9,6 +9,7 @@
import os
+import pkg_resources
import click
@@ -49,9 +50,8 @@ class CliOpenStack(object):
def check(self):
self.ping_endpoint()
- cmd = os.path.join(CONST.__getattribute__('dir_repo_functest'),
- "functest/ci/check_os.sh")
- ft_utils.execute_command(cmd, verbose=False)
+ ft_utils.execute_command("sh %s" % pkg_resources.resource_filename(
+ 'functest', 'ci/check_os.sh'), verbose=False)
def snapshot_create(self):
self.ping_endpoint()
diff --git a/functest/cli/commands/cli_testcase.py b/functest/cli/commands/cli_testcase.py
index 3d3f1cb3..91904d87 100644
--- a/functest/cli/commands/cli_testcase.py
+++ b/functest/cli/commands/cli_testcase.py
@@ -10,6 +10,7 @@
""" global variables """
import os
+import pkg_resources
import click
@@ -25,7 +26,7 @@ class CliTestcase(object):
self.tiers = tb.TierBuilder(
CONST.__getattribute__('INSTALLER_TYPE'),
CONST.__getattribute__('DEPLOY_SCENARIO'),
- CONST.__getattribute__('functest_testcases_yaml'))
+ pkg_resources.resource_filename('functest', 'ci/testcases.yaml'))
def list(self):
summary = ""
@@ -59,8 +60,8 @@ class CliTestcase(object):
else:
tests = testname.split(",")
for test in tests:
- cmd = ("python %s/functest/ci/run_tests.py "
- "%s -t %s" %
- (CONST.__getattribute__('dir_repo_functest'),
+ cmd = ("python %s %s -t %s" %
+ (pkg_resources.resource_filename(
+ 'functest', 'ci/run_tests.py'),
flags, test))
ft_utils.execute_command(cmd)
diff --git a/functest/cli/commands/cli_tier.py b/functest/cli/commands/cli_tier.py
index 531f0ff9..48e9f542 100644
--- a/functest/cli/commands/cli_tier.py
+++ b/functest/cli/commands/cli_tier.py
@@ -10,6 +10,7 @@
""" global variables """
import os
+import pkg_resources
import click
@@ -24,7 +25,7 @@ class CliTier(object):
self.tiers = tb.TierBuilder(
CONST.__getattribute__('INSTALLER_TYPE'),
CONST.__getattribute__('DEPLOY_SCENARIO'),
- CONST.__getattribute__('functest_testcases_yaml'))
+ pkg_resources.resource_filename('functest', 'ci/testcases.yaml'))
def list(self):
summary = ""
@@ -67,8 +68,6 @@ class CliTier(object):
click.echo("Functest environment is not ready. "
"Run first 'functest env prepare'")
else:
- cmd = ("python %s/functest/ci/run_tests.py "
- "%s -t %s" %
- (CONST.__getattribute__('dir_repo_functest'),
- flags, tiername))
+ cmd = ("python %s %s -t %s" % (pkg_resources.resource_filename(
+ 'functest', 'ci/run_tests.py'), flags, tiername))
ft_utils.execute_command(cmd)