summaryrefslogtreecommitdiffstats
path: root/api/resources
AgeCommit message (Collapse)AuthorFilesLines
2017-06-24Add API to update openrc variablechenjiankun1-4/+35
JIRA: YARDSTICK-651 Currently we source openrc variable manually or use yardstick env prepare to get openrc file. We need API to update the openrc variable. api: /yardstick/env/action description: source environment variable method: POST parameters: { 'action': 'update_openrc', 'args':{ 'openrc': { 'OS_USERNAME': 'admin', 'OS_PASSWORD': 'console', 'OS_TENANT_NAME': 'admin', 'OS_AUTH_URL': 'http://192.168.131.222:5000/v2.0', 'EXTERNAL_NETWORK': 'ext-net' } } } Change-Id: I680a7249116c8ff0c1a9e7d5089538d935240c80 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-06-22auto restart influxdb and grafana supportrexlee87761-2/+7
JIRA: YARDSTICK-686 Change-Id: If486df4d825f9d0b03eeaa77716cc2855e2f1bd0 Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2017-04-27Bugfix: yardstick env prepare cmd do not support other installerchenjiankun1-23/+7
JIRA: YARDSTICK-629 Currently yardstick env prepare do not support other installer. I will add follow support: 1. Environment variable already exists: then do not fetch openrc file and do not add EXTERNAL_NETWORK variable. 2. Already have openrc file in /etc/yardstick/openstack.creds: only source this file in API. 3.Environment variable not exists and openrc file not in /etc/yardstick/openstack.creds: fetch openrc file and append EXTERNAL_NETWORK variable. Change-Id: I4ce98f2e17ef8e0a0a1c33c3862ca301c53bb6c2 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-04-01Yardstick virtualenv supportchenjiankun3-42/+41
JIRA: YARDSTICK-620 Currently we recommend using docker to run yardstick. And it is hard to use virtualenv to install yardstick. So I modify install.sh in yardstick root path. It will support using virtualenv to install yardstick(including API) in linux. In this patch, I make yardstick support read yardstick configuration have priority over constants. Change-Id: I9ea1241b228532a6497451e6c8f232173ddb783e Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-03-09Merge "Record test case names when run a task using API"Rex Lee1-4/+21
2017-03-02env prepare check openrc already sourcedrexlee87761-5/+11
env prepare should check if openrc is sourced before using os_fetch_utils to fetch openrc JIRA: YARDSTICK-577 Change-Id: I0efb0bae3b408156b1133812c29583ab8c58d94b Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2017-02-24Add common method of openstack in openstack_utilschenjiankun1-1/+2
JIRA: YARDSTICK-569 We have much redundancy code when using nova/neutron/glance... python client. So I write this code in openstack_utils for calling. Change-Id: I322b7577de4933246a15e6742ae5a28bea16eb02 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-02-23Record test case names when run a task using APIchenjiankun1-4/+21
JIRA: YARDSTICK-509 Currently we use influxdb as database and will not record test case name when run a test suite. So if we must offer test case name if we want to get result from API. I will record test case name when run a test suite. So we needn't offer test case any more when call for get result API. Change-Id: I87ea4770422cbc46aa6671bfcc53bd4498825eef Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-02-22Create Grafana dashboards according config file under root_path/dashboardchenjiankun1-4/+9
JIRA: YARDSTICK-570 Currently we only create ping Grafana dashboard when create Grafana docker container. Actually we need to create some default dashboards. Change-Id: Icee975ad8c1c960b27625274c775f1716edfa03e Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-02-08pylint fixes: remove redundant parens, fix comparison orderRoss Brattain1-1/+1
removed redundant parens in if and while clauses use var != constant, not constant != var. Python doesn't allow for assignment in if statements, so we don't have to use the old C workarounds remove unwanted commas use raw strings for regexps with backslashes, e.g. r'\s' instead of '\s' Change-Id: I7aad645dd3d7f4b4b62f4e4510a425611c9d28f2 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-01-20Create API to get a list of all test caseschenjiankun1-0/+21
JIRA: YARDSTICK-456 Currently we do not have a API to get a list of all test cases; Currently the test case info is from the comment; So I create a API to get a list of all test cases; And create a 'description' attribute to record info of a test case; And use the CLI call this API; Change-Id: Ife800600446683664097835c7b9f11899c85771d Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-01-12Add support for Python 3Ross Brattain4-11/+16
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>
2017-01-11Merge "Create API to run test suite"Rex Lee1-0/+45
2017-01-10Create API to run test suiteJingLu51-0/+45
JIRA: YARDSTICK-475 This API will be used to run test suite files in the test/opnfv/test_suites directory Change-Id: I208edf9abed62fd6436de988ac85bfe99c4d01bd Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-01-10Merge "Add API to get the status of async task"Jing Lu2-19/+107
2017-01-10Add API to get the status of async taskchenjiankun2-19/+107
JIRA: YARDSTICK-526 Currently there are many API run a task using sub thread. But we don't know the status of this task. So we need to offer a API to query the status of this task. Change-Id: I8d2cc558750bf9270aed4a7abb8bf35d17894d83 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-28Record test case names when run a task using APIchenjiankun3-24/+28
JIRA: YARDSTICK-509 Currently we use influxdb as database and will not record test case name when run a test case. So if we must offer test case name if we want to get result from API. Regarding future requirement, I create sqlite database and alchemy orm framework. And record test case name when run a test case. So we needn't offer test case any more when call for get result API. Change-Id: I7d7dc24543a33918546267591f7bdcd0742928cb Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-26Use ConfigParser to write yardstick.confchenjiankun1-22/+12
JIRA: YARDSTICK-474 Currently, I use file.write() method to write config in yardstick.conf. But it is not recommended. So I change to use ConfigParser to write config in yardstick.conf Change-Id: Ia789cf09296afd5d1507bcf99f165378bf87c591 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-22Bugfix: the load_image.sh script will load a image with the same namechenjiankun1-0/+10
JIRA: YARDSTICK-471 Currently, if we execute the load_image.sh and the openstack already have this image in the cloud,this script will load another image with the same name. This will make yardstick run error. So I clean this related images before loading. Change-Id: If5b985ef9b2e890aa10453810fac36867d320a06 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-22Yardstick API refactorchenjiankun5-0/+401
JIRA: YARDSTICK-503 Now in api/views.py there are many redundant code. So I do some refactoring and make it to be a lightweight framework. Change-Id: Id7cecc95e60f5403b2d26239a3ef41d01bbb542a Signed-off-by: chenjiankun <chenjiankun1@huawei.com>