aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/cmd/cli.py
AgeCommit message (Collapse)AuthorFilesLines
2018-02-15Prohibit the importation of a list of librariesRodolfo Alonso Hernandez1-2/+5
Some modules can't be imported and used in Yardstick. For example, "ansible" has GPLv3 license and can't be used as a library in this project without modifying Yardstick license. JIRA: YARDSTICK-896 Change-Id: I9d6bec0493ac50f1051235cc77e81059dfc3e01c Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2017-08-13cli: typo, s/dispath/dispatch/gRoss Brattain1-4/+4
Change-Id: I3df6bc606f2ac78baf611aee22b9247f6f9d5136 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-06-29Call core code directly in the API of run test casechenjiankun1-1/+1
JIRA: YARDSTICK-688 We need to call core code directly in the API of runTestCase. It would be more stable. Change-Id: I431a85ded7cd3b20da0462f947c25d91bb99decd Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-03-17Yardstick: User interface for Yardstick.rajesh_4k1-1/+3
Currently Yardstick doesnt have any UI which gives detail analysis of the test-results. This commit generates a HTML page after the execution of a command "yardstick report generate <task-ID> <TC-name>" which intern can be executed after the execution of test-case. Used: Highcharts.js for the graphs. JIRA: YARDSTICK-280 Change-Id: Ic98cc348719f3922bff178f52e7944a4a931763a Signed-off-by: Rajesh K <4k.rajesh@gmail.com>
2017-02-28stream default INFO, filehdr default DEBUGrexlee87761-10/+3
The DEBUG log can be stored as file and pushed into artifacts. Default sys.out level should be INFO. Stream level can be changed to DEBUG if cli "-d" is enabled. remove "-v" since it's not useful for a test framework JIRA: YARDSTICK-507 Change-Id: I3caafd31a2caac73b0e3f33c2762c090e76c707e Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2017-01-16Use """ to replace ''' in docstringchenjiankun1-7/+7
JIRA: YARDSTICK-525 For consistency, we always use """triple double quotes""" around docstrings. Change-Id: I47a20bbd8b55bc544b4841ea4006929af0a044ac Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-01-12Add support for Python 3Ross Brattain1-0/+1
Porting to Python3 using Openstack guidelines: https://wiki.openstack.org/wiki/Python3 This passes unittests on Python 3.5 and passes opnfv_smoke suite Updates: use six for urlparse and urlopen fix exception.message attribute removal run unittests on python3 use unitest.mock on python 3 fix open mock for vsperf fix float division by using delta/eplison comparison use unicode in StringIO use plugin/sample_config.yaml relative path from test case fixed apexlake unittests upgraded to mock 2.0.0 to match python3 unittest.mock features fixed flake8 issues implement safe JSON decode with oslo_serialization.jsonutils.dump_as_bytes() implement safe unicode encode/decode with oslo_utils.encodeutils heat: convert pub key file from bytes to unicode pkg_resources returns raw bytes, in python3 we have to decode this to utf-8 unicode so JSON can encode it for heat template JIRA: YARDSTICK-452 Change-Id: Ib80dd1d0c0eb0592acd832b82f6a7f8f7c20bfda Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2016-12-02argsAlreadyParsedError: arguments already parsed: cannot register CLI optionchenjiankun1-12/+14
JIRA: YARDSTICK-216 Change-Id: I0368a3d1c1f5eaf9f4ef2dcb519815241f377d24 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-11-29centralize logging into root loggerRoss Brattain1-6/+4
If we setup root logger correctly and have each module logger propogate we shouldn't need individual logger configuration updates: lower paramiko to WARN level dispatcher/file.py was missing logging.handlers import purge all existing handlers and add our own handlers move everything back into yardstick/__init__.py so API can use it make _LOG_STREAM_HDLR global, so we can set loglevel on it whenever added api/server.py call to _init_logging removed old LOG_FORMATTER from cli.py only setLevel on yardstick logger Change-Id: If000799590379d3407655a7d54378481a96ea3d4 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2016-11-30Create API and command to create a influxDB containerchenjiankun1-1/+3
JIRA: YARDSTICK-425 This API is used to create a influxDB Container Add command line to create a influxDB Container, too Change-Id: If9c2d04b779924d492a5d5ea91f7968fa959570e Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-11-25ArgsAlreadyParsedError: arguments already parsed: cannot register CLI optionchenjiankun1-1/+16
JIRA: YARDSTICK-216 When I call YardstickCLI in flask, it will always encounter a ArgsAlreadyParsedError if the API run test case more than two times. In YardstickCLI, if I just call CONF.clear(), it will occur another error due to other opts not unregister. I don’t know if the problem is on the oslo.config side. I solve the problem by unregister the opts. Change-Id: Ic898c8d62625785ceb793c75e8210ac354ac63bf Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-11-21Create API to run test caseschenjiankun1-4/+4
JIRA: YARDSTICK-413 Change-Id: Ibf58b50b568fae3f2eea985b25ee33be0a3666b7 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-11-09Add task call entry in cli for REST APIchenjiankun1-2/+33
JIRA: YARDSTICK-368 This is to add api entry for api, the way to use cli will not be changed The command line will use main method, and the api will use api method The **kwargs in do_start will receive the args from api entry Change-Id: Ic487344436f4596cd2efd70e008c8ea862778f2e Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-06-28Add plugin CommandJingLu51-1/+3
Change-Id: I8976ddf3dd43813ee38051dc4b0030265b85c3ef Signed-off-by: JingLu5 <lvjing5@huawei.com>
2016-03-26add "yardstick testcase list" command functionkubi1-1/+3
"yardstick testcase list" will list test cases info(Name, Description) in tests/OPNFV/test_cases/ Change-Id: Icf2e6a803d90d33012f009519e47e750bfd57489 JIRA:- Signed-off-by: kubi <jean.gaoliang@huawei.com>
2016-01-13Fix flake8 errorsJo¶rgen Karlsson1-2/+3
Change-Id: I14f21092f5e97abf0629a92a27062846a6d3130b JIRA:- Signed-off-by: Jo¶rgen Karlsson <jorgen.w.karlsson@ericsson.com>
2015-10-15Support general configuration fileQiLiang1-53/+49
Use openstack library oslo_config for parsing configuration options from the command line and configuration files. Refer http://docs.openstack.org/developer/oslo.config/ or rally source code for more info on oslo_config library usage. This patch is initially for test result dispatcher configuration, but it is very general to use. Usage: 0) install yardstick 1) mkdir /etc/yardstick 2) cp <repo_root_dir>/etc/yardstick/yardstick.conf.sample \ /etc/yardstick/yardstick.conf 3) edit /etc/yardstick/yardstick.conf 4) run `yardstick task start xxx` cmd JIRA: YARDSTICK-61 Change-Id: I01677ef6e9ab7c1975aa193799195e850da73478 Signed-off-by: QiLiang <liangqi1@huawei.com>
2015-07-14Fix bug in cli.pykubi1-1/+1
Make sure log level set correctly. JIRA: YARDSTICK-57 Change-Id: Icc0e100432ce773f70ee0ac9b18471f89849d990 Signed-off-by: kubi <jean.gaoliang@huawei.com>
2015-06-29Add support to list and show runners & scenariosHans Feldt1-1/+5
Example usage and output: $ yardstick runner list +------------------------------------------------------------------------------+ | Type | Description +------------------------------------------------------------------------------+ | Duration | Run a scenario for a certain amount of time | Arithmetic | Run a scenario arithmetically stepping an input value | Constant | Run a scenario a certain number of times +------------------------------------------------------------------------------+ $ yardstick runner show Duration Run a scenario for a certain amount of time If the scenario ends before the time has elapsed, it will be started again. Parameters duration - amount of time the scenario will be run for type: int unit: seconds default: 1 sec interval - time to wait between each scenario invocation type: int unit: seconds default: 1 sec $ yardstick scenario list +------------------------------------------------------------------------------+ | Type | Description +------------------------------------------------------------------------------+ | Iperf3 | Execute iperf3 between two hosts | Pktgen | Execute pktgen between two hosts | Ping | Execute ping between two hosts +------------------------------------------------------------------------------+ $ yardstick scenario show Iperf3 Execute iperf3 between two hosts By default TCP is used but UDP can also be configured. For more info see http://software.es.net/iperf Parameters bytes - number of bytes to transmit only valid with a non duration runner, mutually exclusive with blockcount type: int unit: bytes default: 56 udp - use UDP rather than TCP type: bool unit: na default: false nodelay - set TCP no delay, disabling Nagle's Algorithm type: bool unit: na default: false blockcount - number of blocks (packets) to transmit, only valid with a non duration runner, mutually exclusive with bytes type: int unit: bytes default: - JIRA: - Change-Id: If218e129a30af7e20792190003c214677e732252 Signed-off-by: Hans Feldt <hans.feldt@ericsson.com>
2015-06-18add new command line handlerJo¶rgen Karlsson1-0/+128
New command line handler with pluggable classes. Task subcommand added. To run a scenario: yardstick -d task start samples/ping.yaml $ yardstick -h usage: yardstick [-h] [-V] [-d] [-v] {task} ... Command-line interface to yardstick optional arguments: -h, --help show this help message and exit -V, --version display version -d, --debug increase output verbosity to debug -v, --verbose increase output verbosity to info subcommands: {task} $ yardstick task -h usage: yardstick task [-h] {start} ... Task commands. Set of commands to manage benchmark tasks. optional arguments: -h, --help show this help message and exit subcommands: {start} $ yardstick task start -h usage: yardstick task start [-h] [--keep-deploy] [--parse-only] [--output-file OUTPUT_FILE] taskfile Start a benchmark scenario. positional arguments: taskfile path to taskfile optional arguments: -h, --help show this help message and exit --keep-deploy keep context deployed in cloud --parse-only parse the benchmark config file and exit --output-file OUTPUT_FILE file where output is stored, default /tmp/yardstick.out JIRA :- Signed-off-by: Jo¶rgen Karlsson <jorgen.w.karlsson@ericsson.com> Change-Id: If0672594efa4c94c94ebb73f0bc97ecfe3e00c62