2 ##############################################################################
3 # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
13 from command_group.testcase import Testcase
15 CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
18 @click.group(context_settings=CONTEXT_SETTINGS)
19 @click.version_option(version='0.1')
22 """cli for bottlenecks project
25 bottlenecks testcase run <testcase>
30 _testcase = Testcase()
36 """testcase cli group for bottlenecks project"""
40 @testcase.command('run', help="To execute a test case.")
41 @click.argument('testname', type=click.STRING, required=True)
42 @click.option('-n', '--noclean', is_flag=True, default=False,
43 help='Openstack resources created by the test'
44 'will not be cleaned after the testcase execution.')
45 def testcase_run(testname, noclean):
46 _testcase.run('-c ' + testname, noclean)
52 """teststory cli group for bottlenecks project"""
56 @teststory.command('run', help="To execute a test story.")
57 @click.argument('testname', type=click.STRING, required=True)
58 @click.option('-n', '--noclean', is_flag=True, default=False,
59 help='Openstack resources created by the test'
60 'will not be cleaned after the teststory execution.')
61 def teststory_run(testname, noclean):
62 _testcase.run('-s ' + testname, noclean)