Merge "Delete functest.utils.functest_logger"
[functest.git] / functest / cli / cli_base.py
index 827f8a4..2104e12 100644 (file)
@@ -8,11 +8,14 @@
 #
 
 import click
+import logging.config
 
 from functest.cli.commands.cli_env import CliEnv
 from functest.cli.commands.cli_os import CliOpenStack
 from functest.cli.commands.cli_testcase import CliTestcase
 from functest.cli.commands.cli_tier import CliTier
+from functest.utils.constants import CONST
+
 
 CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
 
@@ -20,7 +23,9 @@ CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
 @click.group(context_settings=CONTEXT_SETTINGS)
 @click.version_option(version='opnfv colorado.0.1 ')
 def cli():
-    pass
+    logging.config.fileConfig(
+        CONST.__getattribute__('dir_functest_logging_cfg'))
+
 
 _env = CliEnv()
 _openstack = CliOpenStack()
@@ -120,8 +125,11 @@ def testcase_show(testname):
 @click.option('-n', '--noclean', is_flag=True, default=False,
               help='The created openstack resources by the test'
               'will not be cleaned after the execution.')
-def testcase_run(testname, noclean):
-    _testcase.run(testname, noclean)
+@click.option('-r', '--report', is_flag=True, default=False,
+              help='Push results to the results DataBase. Only CI Pods'
+              'have rights to do that.')
+def testcase_run(testname, noclean, report):
+    _testcase.run(testname, noclean, report)
 
 
 @tier.command('list', help="Lists the available tiers.")
@@ -146,5 +154,8 @@ def tier_gettests(tiername):
 @click.option('-n', '--noclean', is_flag=True, default=False,
               help='The created openstack resources by the tests'
               'will not be cleaned after the execution.')
-def tier_run(tiername, noclean):
-    _tier.run(tiername, noclean)
+@click.option('-r', '--report', is_flag=True, default=False,
+              help='Push results to the results DataBase. Only CI Pods'
+              'have rights to do that.')
+def tier_run(tiername, noclean, report):
+    _tier.run(tiername, noclean, report)