aboutsummaryrefslogtreecommitdiffstats
path: root/api
AgeCommit message (Collapse)AuthorFilesLines
2019-02-11Add ability to get data from different DBs in influxEmma Foley1-8/+11
In order to get data from Barometer, the influx helper need to be updated to recognise different DBs. This patch adds an optional arg to specify which database to use. By default, the configured dispatcher for Yardstick is used. Limitation: The new change hard codes barometer DB name to be used, and assumes that it is in the same instance of Influx as the Yardstick dispatcher. This can be extended later to make it configurable, however, a new config option would have to be introduced. JIRA: YARDSTICK-1593 Change-Id: Idee9c3491d6bf7b549e014edd9ff031312cf0ec2 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-05-22Bugfix: openrc api dump should be safe_dumprexlee87762-6/+9
1. fix safe_dump 2. fix pep8 problem, use flask_restapi custom error handling [1] [1] https://flask-restful.readthedocs.io/en/latest/extending.html#custom-error-handlers JIRA: YARDSTICK-1165 RestApi openrc dump clouds.yaml error it now use yarml.dump, should be yaml.safe_dump. dump would gererate !!python/unicode and cause error when upload openrc file in gui Change-Id: Id3e85f7ba7d4967277ef79109b07d7552179e5db Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2018-05-04Parse "dispatcher" options correctly from InfluxDB clientRodolfo Alonso Hernandez1-12/+16
The InfluxDB client needs first to retrieve which dispatchers are available from "DEFAULT:dispatcher". This parameter accepts comma separated values. "get_data_db_client" method needs to search for "influxdb" in this string parameter. JIRA: YARDSTICK-1136 Change-Id: I5efafcffbd3dbf906ca9bebd75b3717df8bbb75d Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-04-12Bugfix: Can't get image list in APIchenjiankun1-46/+23
JIRA: YARDSTICK-1110 To match OpenStack Pike release, we upgrade novaclient from 7.1.1 to 9.1.1. And the client interface has changed, it no longer has nova_client.images attribute. So I use shade instead. Later will change all same issue. Change-Id: Ie4f54069d4346e44e2ad925439930504b945cbad Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2018-03-27Merge "env: validate installer_ip from environment"Rodolfo Alonso Hernandez1-0/+6
2018-03-22Bugfix: Error when using API(v1) to run test suitechenjiankun1-1/+2
JIRA: YARDSTICK-1098 The reason is missing TasksHandler parameter to run test suite. Change-Id: I9dd45caa87d0e39afbf7485443a6e566317f5cea Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2018-03-20env: validate installer_ip from environmentRoss Brattain1-0/+6
validate installer_ip is proper IPv4 address in case of user error Change-Id: Ib01916bc85ec411c159af1564f5142177f464047 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2018-03-16Merge "Supporting user config task parameters in GUI"Jack Chan2-2/+23
2018-03-15Create API to get SUT informationchenjiankun2-1/+35
JIRA: YARDSTICK-1072 We need to show SUT information in GUI. Change-Id: I40bcd513f3c6a443c82764687637ac5258b99584 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2018-03-08Supporting user config task parameters in GUIchenjiankun2-2/+23
JIRA: YARDSTICK-981 We need to add function to enable user to config task parameters in GUI. The way to config must be more friendly. Change-Id: I8746149084f1d554b48ed392f2fef4748e279dfb Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2018-03-01Bugfix: yardstick env grafana fails when access the serverrexlee87761-1/+1
current timeout is 10 seconds, it would fail if grafana server start slow in some cases. JIRA: YARDSTICK-972 Change-Id: I783206fdd1352e94ba7e498283f70b5a6834b6fa Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2018-02-28fix pep8 problem in env.pyrexlee87761-8/+10
JIRA: YARDSTICK-1033 Change-Id: Ia0f745b1a21845afc5c3b3ec58d7a79da56d6a6c Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2017-09-30Remove checkno.png and checkyes.png due to license issuechenjiankun1-2/+2
JIRA: YARDSTICK-817 Since checkno.png and checkyes.png is not Apache-2 license based. so we need to remove them. Change-Id: I40dd303fb54a3736ca969ac1c186d2cd23408436 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-09-26Merge "Read user & password from yardstick.conf in Grafana configuration"Rex Lee2-20/+8
2017-09-21Introduced timeout to post method of HttpClientMaciej Skrocki1-1/+1
We seen cases where grafana container bring-up code would fail, because of too quick access to the http api. Added 10sec timeout for the first query of the API. Change-Id: Ifc95a626d0ab5552a1f26fb167fc3f65791392d7 Signed-off-by: Maciej Skrocki <maciej.skrocki@intel.com>
2017-09-15Read user & password from yardstick.conf in Grafana configurationchenjiankun2-20/+8
JIRA: YARDSTICK-812 Currently grafana data source configuration is hardcoding . It is a risk. so I read it from yardstick.conf. Change-Id: I8a9c8afbce6c4534fc43a0bfb5c56d67a8b59db0 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-09-14bugfix: show testcase api return type errorrexlee87761-1/+7
segmentation_id should be number, provider should be string Change-Id: Iabdc08cb0989f4d585013b5a8ef3662442eeda45 Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2017-08-31Add API(v1) to get real time logchenjiankun2-0/+51
JIRA: YARDSTICK-805 We need to get real time log if we use API(v1) run test case. API: /yardstick/tasks/<task_id>/log For example: http://ip:port/yardstick/tasks/14795be8-f144-4f54-81ce-43f4e3eab33f/log?index=0 Change-Id: Ic0bf10f26f4f07d3264f2415c4923a1bfded2f81 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-08-28Merge "DRAFT: update yardstick generic test cases dashboard"Ross Brattain1-3/+3
2017-08-25Merge "Add function to upload image from local/url in GUI"Jing Lu6-31/+328
2017-08-24Add function to upload image from local/url in GUIchenjiankun6-31/+328
JIRA: YARDSTICK-782 As user, we need to upload image from local/url. If upload image from local, user need to choose local image, then we will load it to openstack. If upload image from url, we will download it and load it to openstack. Change-Id: Ia9a42fda15a1dfc91476643635343a2f77a94a6b Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-08-22DRAFT: update yardstick generic test cases dashboardrexlee87761-3/+3
current dashboard is obselete and hard to understand add local grafana dashboard automatically import by "yardstick env grafana" update grafana version to latest steady Change-Id: Iffae9170231d3e0867a52a1f6b5e99c4650b7326 Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2017-08-15YAML fixesRoss Brattain2-3/+4
There are multiple issues wiht YAML loading. 1. Jinja2 renders None values as a string 'None'. This is not valid YAML we need to render None values to '~' or 'null' which is the native YAML None value. 2. Jinja2 renders dict and lists that contain unicode with u'foo' values. This is not value YAML syntax. Because we are serializing dict and lists into YAML, we need to encode them as valid YAML. We can override Jinja2 finalize to use yaml.dump to dump inline YAML. We use yaml.safe_dump(elem, default_flow_style=True).replace('\n', '') to generate valid single-line YAML dict and list values. But this problem highlights the general difficulties with templating and loading files. We could avoid this Python->Jinja2->YAML->Python issue by directly injecting the list or dict after the YAML is loaded. I'm not sure of the real utility of these templates. 3. On Python 2 YAML loader is rendering all strings as unicode. This does not work for Trex because Trex is broken and badly coded. Trex does type checking against str() which is different for Python 2 and Python 3. The default YAML loader will return native string types, str() or unicode() for Python 2 and Python 3 respectively. The bad Trex codes is in convert_val: https://github.com/cisco-system-traffic-generator/trex-core/blob/master/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py#L674 def convert_val (val): if is_integer(val): return val if type(val) == str: return ipv4_str_to_num (is_valid_ipv4(val)) raise CTRexPacketBuildException(-11,("init val invalid %s ") % val ); This code is doing type(val) == str. This is bad and broken. We can't fix Trex, so we have to render all strings as native str() types The bug here was that the Heat template loader template_format.py was overriding the global YAML loader to always return unicode. We don't want this global override. To fix this we have to use local subclasses of the yaml.SafeLoader class. But in order to dynamically subclass from CSafeLoader or SafeLoader we have to use the type() builtin to define a new class at runtime. Once we have new classes defined, we can safely isolate different YAML constructors and return unicode or not depending on the case. To be consistent we implement a new yaml_loader.py module to centralize all non-Heat template yaml loading to ensure correct uncode/str conversion Change-Id: Iebf9cf78fbda390977c390436b0869e7bbf503eb Signed-off-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-11Add real time log view in GUIchenjiankun3-2/+37
JIRA: YARDSTICK-775 We have GUI now, but we can't see real time log in GUI view. So I add real time log view in GUI. Change-Id: Ie83f327ef0a94302afa6b3def764fec6ef5818d1 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-08-09bugfix: hosts should be clean if update_hosts twicerexlee87761-3/+11
JIRA: YARDSTICK-774 Change-Id: Id610d43d236ab3a7d1aa4b8cfd230a40958fac38 Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2017-08-03Merge "replace yaml.load with yaml.safe_load"Ross Brattain1-1/+1
2017-08-02Add task-args(from yaml file) candidates in /api/v2/yardstick/testcases APIchenjiankun1-1/+6
JIRA: YARDSTICK-766 We have the demand to get all task-args candidates in test case yaml file, so that user get easily change it. The response will like: { 'status': 1, 'result': { 'testcase': case content, 'args': { 'image': {'description': '', 'type': 'String'} } } } In this patch, I add jinja2schema 0.1.4 in requirements.txt. Change-Id: I450082402370add5ab29090286f026fe3cc8c36e Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-08-01replace yaml.load with yaml.safe_loadRoss Brattain1-1/+1
yaml.safe_load is safer, obviously. anteater will check for this template_format use specialized constructor based on yaml.SafeLoader JIRA: YARDSTICK-760 Change-Id: Ia3b0b3aa0765385a0ee472a4d83f49d424b5a77f Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-07-27Merge "Yardstick GUI & GUI deployment"Jing Lu6-87/+9
2017-07-27Yardstick GUI & GUI deploymentchenjiankun6-87/+9
JIRA: YARDSTICK-758 As E release plan, we have the need of yardstick GUI. This patch is GUI front end code and deployment. The backend code is yardstick API. Change-Id: Ib15f78bcc50168c7828beff97256e9939c6da809 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-25Merge "yardstick env influxdb/grafana cmd support centos"Rex Lee1-17/+35
2017-07-24Bugfix: missing license in api directorychenjiankun10-1/+73
JIRA: YARDSTICK-759 In api directory, there are many files missing license header. We need to add it. Change-Id: Ia46cf207295007d4eb7fbf0d3319611f256c36bc Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-21Add API(v2) to get all task infochenjiankun2-0/+13
JIRA: YARDSTICK-754 API: /api/v2/yardstick/tasks METHOD: GET Change-Id: I556b0880674d78d67e0a556c4d95f902131cd027 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-21Merge "Add API(v2) to run task"Jing Lu3-17/+72
2017-07-21Merge "Add API(v2) to get all images"Jing Lu1-0/+28
2017-07-21Merge "Add API(v2) to load images"Jing Lu1-0/+44
2017-07-21Add API(v2) to run taskchenjiankun3-17/+72
JIRA: YARDSTICK-741 API: /api/v2/yardstick/tasks/<task_id> METHOD: PUT PARAMS: { 'action': 'run' } Change-Id: Ia5340c6ff45e3e7e70ab4597c39476138e7016f2 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-21Add API(v2) to get all imageschenjiankun1-0/+28
JIRA: YARDSTICK-752 API: /api/v2/yardstick/images METHOD: GET Change-Id: I7b0bba85d875575ee684cc42cad977af91d6f84e Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-21Merge "Add API(v2) to add suite to task"Rex Lee1-0/+23
2017-07-21Add API(v2) to load imageschenjiankun1-0/+44
JIRA: YARDSTICK-751 API: /api/v2/yardstick/images/action METHOD: POST PARAMS: { 'action': 'load_image' } Change-Id: I9554f35c679ae2a861c7922080aa54a1ffc5bac7 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-21Add API(v2) to add suite to taskchenjiankun1-0/+23
JIRA: YARDSTICK-740 API: /api/v2/yardstick/tasks/<task_id> METHOD: PUT PARAMS: { 'action': 'add_suite', 'args': { 'suite_name': 'opnfv_smoke', 'suite_content': suite_content } } Change-Id: I1f81c45f143b2fea636cb87f60f2f394bf1380b1 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-21Merge "Add API(v2) to delete certain test suite"Rex Lee1-0/+10
2017-07-21Merge "Add API(v2) to get certain test suite info"Rex Lee2-1/+16
2017-07-21Merge "Add API(v2) to get all test suite"Rex Lee1-0/+12
2017-07-21Merge "Add API(v2) to create test suite"Rex Lee1-0/+44
2017-07-21Merge "Add API to delete certain test case"Rex Lee1-0/+11
2017-07-21Merge "Add API(v2) to get certain test case info"Rex Lee1-0/+16
2017-07-21Merge "Add API(v2) to get all test case info"Rex Lee1-0/+7
2017-07-21Merge "Add API(v2) to upload test case"Rex Lee1-0/+28
2017-07-21Merge "Add API(v2) to add case to task"Rex Lee1-0/+23