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 import functest.utils.functest_utils as ft_utils
18 import functest.utils.functest_vacation as vacation
19 import functest.utils.functest_constants as ft_constants
25 CI_INSTALLER_TYPE = ft_constants.CI_INSTALLER_TYPE
26 CI_SCENARIO = ft_constants.CI_SCENARIO
27 testcases = ft_constants.FUNCTEST_TESTCASES_YAML
29 self.tiers = tb.TierBuilder(CI_INSTALLER_TYPE, CI_SCENARIO, testcases)
33 for tier in self.tiers.get_tiers():
34 for test in tier.get_tests():
35 summary += (" %s\n" % test.get_name())
38 def show(self, testname):
39 description = self.tiers.get_test(testname)
40 if description is None:
41 click.echo("The test case '%s' does not exist or is not supported."
44 click.echo(description)
46 def run(self, testname, noclean=False):
47 if testname == 'vacation':
49 elif not os.path.isfile(ft_constants.ENV_FILE):
50 click.echo("Functest environment is not ready. "
51 "Run first 'functest env prepare'")
54 cmd = ("python %s/functest/ci/run_tests.py "
55 "-n -t %s" % (ft_constants.FUNCTEST_REPO_DIR, testname))
57 cmd = ("python %s/functest/ci/run_tests.py "
58 "-t %s" % (ft_constants.FUNCTEST_REPO_DIR, testname))
59 ft_utils.execute_command(cmd)