diff options
Diffstat (limited to 'functest/cli/commands')
-rw-r--r-- | functest/cli/commands/cli_env.py | 5 | ||||
-rw-r--r-- | functest/cli/commands/cli_os.py | 6 | ||||
-rw-r--r-- | functest/cli/commands/cli_testcase.py | 9 | ||||
-rw-r--r-- | functest/cli/commands/cli_tier.py | 9 |
4 files changed, 15 insertions, 14 deletions
diff --git a/functest/cli/commands/cli_env.py b/functest/cli/commands/cli_env.py index 8094c84e..ce977572 100644 --- a/functest/cli/commands/cli_env.py +++ b/functest/cli/commands/cli_env.py @@ -8,6 +8,7 @@ # import os +import pkg_resources import click import prettytable @@ -35,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): 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) |