3 # jose.lausuch@ericsson.com
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
10 """ global variables """
16 import functest.ci.tier_builder as tb
17 from functest.utils.constants import CONST
18 import functest.utils.functest_utils as ft_utils
19 import functest.utils.functest_vacation as vacation
22 class CliTestcase(object):
25 self.tiers = tb.TierBuilder(
26 CONST.__getattribute__('INSTALLER_TYPE'),
27 CONST.__getattribute__('DEPLOY_SCENARIO'),
28 CONST.__getattribute__('functest_testcases_yaml'))
32 for tier in self.tiers.get_tiers():
33 for test in tier.get_tests():
34 summary += (" %s\n" % test.get_name())
37 def show(self, testname):
38 description = self.tiers.get_test(testname)
39 if description is None:
40 click.echo("The test case '%s' does not exist or is not supported."
43 click.echo(description)
46 def run(testname, noclean=False, report=False):
54 if testname == 'vacation':
56 elif not os.path.isfile(CONST.__getattribute__('env_active')):
57 click.echo("Functest environment is not ready. "
58 "Run first 'functest env prepare'")
60 tests = testname.split(",")
62 cmd = ("python %s/functest/ci/run_tests.py "
64 (CONST.__getattribute__('dir_repo_functest'),
66 ft_utils.execute_command(cmd)