summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/tests/unit
AgeCommit message (Collapse)AuthorFilesLines
2017-08-18update customs in scenarioSerenaFeng2-8/+63
1) post to add one or multiple test cases 2) update to substitute all the test cases 3) delete with body to delete one or multiple test cases 4) to facilitate the process and response body usually useless, if update success all updates(scores/trust_indicators/customs), return 200 with no response body Change-Id: I5148f172989fa8e0e70ffed92ee383c0520dbb41 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-08-17impl update trust_indicator in scenarioSerenaFeng1-0/+11
Change-Id: I1afe38412926778bc84d178dbbfc3fe0cde15f69 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-08-15update scenario scoresSerenaFeng2-4/+59
update score url: POST /api/v1/scenarios/<scenario_name>/scores? \ installer=<installer_name>& \ version=<version_name>& \ project=<project_name> add new score record interface add unit test add swagger specification Change-Id: Ib7bb31f303a9a9402325476bfdadb58aa0df560e Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-08-14delete obsolete scenario update codeSerenaFeng1-217/+8
1) update scenario will be subsitituted with new methods, in this patch delete the obsolete code first to make clean room 2) test_queryCombination() will fail randomly, in this patch disable it first, reopen when problem solved Change-Id: I1939876465934ea09894255712057a78f120be71 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-07-26merge swagger_base_url with ui_urlSerenaFeng6-11/+11
TestAPI used to have only one webpage, which is swagger_ui, now a new one webportal is added, and the base url is the same (http://testresults.opnfv.org/test)for them both. This patch aim to unify the urls. Change-Id: I15295975fb05f7e8c8d413e12b2b5c0784f0799a Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-07-21separate db methods from handler.pySerenaFeng2-7/+4
db methods are mingled in handler, which is not well structured Change-Id: I639679d3fc05a0b6528158186b8bf89e0cd10596 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-07-20decouple the mutual-dependence of config.py and server.pySerenaFeng5-32/+40
Currently server.py relies on CONF while starting the service, and config.py's config_fie is set in server.py, which is wrongly bi-depended this patch aims to let Config parse the sys.argv personally, just as oslo.config do, so that decouple the mutual-dependency Change-Id: I46887d122a98d478caebe9eeb7ab038941ce1f6b Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-07-20role based access control and result uploadgrakiss3-6/+59
1. add role for user 2. user can upload test results Change-Id: I1c5370be7818edb0394f05e8b81f975deb98b286 Signed-off-by: grakiss <grakiss.wanglei@huawei.com>
2017-07-19Merge "bugfix: query doesn't work well with period=1"Serena Feng2-7/+29
2017-07-19bugfix: query doesn't work well with period=1SerenaFeng2-7/+29
when querying by date, if $lt is not provided, the empty/None/null/'' results will also be returned, the patch aims to fix this issue by adding $lt = datetime.now() if not provided JIRA: RELENG-212 Change-Id: Ida1e7d386a88d4ab640441df161c1fe134593f82 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-07-19bugfix: mix order of Arno resultsSerenaFeng1-1/+1
because start_date is not always in the same format or timezone, sort by start_date will be misordered some times, in this patch leverage '_id' to do the sort, it is generated by mongodb itself, always upscend. JIRA: FUNCTEST-694 JIRA: RELENG-213 Change-Id: Ie0ed5cd09c3f7abb1803d72abe5ecab440c1569c Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-07-14testapi: bugfix of toxMatthewLi3-0/+3
error log https://gerrit.opnfv.org/gerrit/#/c/37053/ https://build.opnfv.org/ci/job/testapi-verify-master/220/console Change-Id: Id278edad06c2852c662392d75fd3cf4041b03451 Signed-off-by: MatthewLi <lijun_1203@126.com>
2017-07-12move resources unit tests to tests/unit/resourcesSerenaFeng12-13/+13
As webportal is introduced, the project structure is becoming more complex, it is time to make it a a little bit more official Change-Id: Id380d37b07719f053b0bd385a326a2f2944a4b22 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-06-27bugfix: pagination crash due to memory limitationSerenaFeng1-7/+27
MongoDB sorts the results in memory, and the default mem limitation is 32M, if the sort operation consumes more than that it will return an error: OperationFailure: Executor error during find command: OperationFailed Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit. To solve this problem, here we leverage aggregate() and allowDiskUse=True, it is said will not be limited by memory Change-Id: Id698ad1d02912e8b350a33a926fcccc390814fcc Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-06-20support pagination in TestAPISerenaFeng1-5/+20
In this patch, pagination is supported, so you can go through results leveraging: http://testresults.opnfv.org/test/api/v1/results?page=2 Change-Id: Ibe31c787643f27dbb06c4899e713b3c8e716e784 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-05-17refactor static_path to accomodate web portalSerenaFeng1-1/+6
move tornado_swagger/static to opnfv_testapi/static move swagger related 3rd libs to 3rd_party/swagger Change-Id: I32bba10584c99d13687b93f32577e37581db0c63 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-05-12refactor config parser to facilitate adding new configsSerenaFeng1-26/+6
refactor hardcoded config.py to facilitate adding new configurations come along with web portal and Authentication features Change-Id: Ibc16166ade0d6e730bb4c9d81e9b9bc9b297faa1 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-05-05Merge "leverage executor to test_testcase.py in TestAPI"Serena Feng1-59/+64
2017-05-05Merge "leverage executor to test_project.py in TestAPI"Serena Feng1-61/+55
2017-05-05Merge "leverage executor to test_result.py in TestAPI"Serena Feng1-103/+105
2017-04-13leverage executor to test_token/version.py in TestAPISerenaFeng2-42/+41
Change-Id: Ia1e6b0e787d477a19c78b56ff249d544b49a087b Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-04-13leverage executor to test_testcase.py in TestAPISerenaFeng1-59/+64
Change-Id: I8bb7459e5dee49cd120e848ac70834c8d9665a45 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-04-13leverage executor to test_result.py in TestAPISerenaFeng1-103/+105
Change-Id: Ie4388a4be0cb174129ac168530559114046680ab Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-04-13leverage executor to test_project.py in TestAPISerenaFeng1-61/+55
Change-Id: I2ebc86a4c395182ca783d3d36befbed2a21f512b Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-04-13impl executor and leverage to test_pod.py in TestAPISerenaFeng2-24/+107
implement executor.py leverage executor to test_pod.py Change-Id: Ief70a28a935c86430e26f90f35112a7bab9fa81b Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-04-10import from absolute path in TestAPI unitSerenaFeng9-10/+10
Change-Id: Ic42db22d825229713b38c75c141af7742ca65dd3 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-04-06change not_found to forbidden when db not existSerenaFeng1-3/+3
Change-Id: I1aa61c5d1b057b5a53cf6369b26605867a4d092e Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-04-06unify error message in TestAPISerenaFeng6-30/+36
Change-Id: I994feb7bf340c9e48bebe9fdf3dc3a76bc254652 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-03-30replace self-defined http codes with standard definitionsSerenaFeng6-81/+81
Change-Id: I3045dc690e0bc1186f5c548cb533462dd03130d9 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-03-29add rename scenario exceptionsSerenaFeng1-8/+49
JIRA: RELENG-163 Change-Id: I680a181a3c1728034e5782de4bc65cc07f64540c Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-03-28keep methods' name/docstring after decoratorSerenaFeng1-0/+2
applying functools.wraps() to keep the name and docstring of the original function which is decorated Change-Id: Id612039921566dd48f8d8797abe30f23aaf99301 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-03-01bugfix unittest test_queryProject occasionally failed in TestAPISerenaFeng1-4/+4
error message: "E AssertionError: Mismatched values: u'installers', expected:[], actual: [] Change-Id: Ieae5fdfd2a044909784cbb4766a5d25f4bbafcea Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-02-27make unittest cover server.py in TestAPISerenaFeng2-8/+38
Change-Id: Id379e6786e1f61fb1032f80636da107156e68fb5 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-02-24add unittest of config.pySerenaFeng6-0/+97
Change-Id: I96639c47d27ef449d02528efad23e2499daa3def Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-02-22Add unit tests to token based authenticationrohitsakala2-0/+119
Projects has been choosen as an helper to test token success,invalid and unauthorized JIRA: FUNCTEST-739 Change-Id: Iecc68821f5cc85630c17e54144723cc6f5e21ded Signed-off-by: rohitsakala <rohitsakala@gmail.com>
2017-02-21Add token based authentication for post/update/deleterohitsakala1-0/+1
As the mongodb database is not so secure today, this has been added. The token is stored in the mongoDB database. For now, authenticate variable is set false so that there would be no problem in accessing the databse by jenkins jobs. JIRA: FUNCTEST-730 Change-Id: I12b3907d650fc63efbdb031ebf3dd09519750109 Signed-off-by: rohitsakala <rohitsakala@gmail.com>
2017-02-21fix violation of import rule in TestAPISerenaFeng8-170/+174
TestAPI violate import rule of OpenStack Style a lot, like Do not import objects, only modules Do not import more than one module per line Alphabetically order your imports by the full module path This patch is mean to fix them. Change-Id: Ia05b944a74b3f443c9101a9840f613f9a6f5ae49 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-02-15implement delete and related unittestSerenaFeng1-12/+23
JIRA: RELENG-163 Change-Id: I7fe45f3e92c3dc5f5b32582561249150a2cdb8cf Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-02-09update scenario and related unittestSerenaFeng1-16/+188
JIRA: RELENG-163 Change-Id: I137898dc84de5f8cb6cab5de9b4ac5de5e4bb978 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-01-18implement get/query scenario(s) and add unittestSerenaFeng5-17/+220
supported queries: scenario name/version/installer/project JIRA: RELENG-163 Change-Id: I3f6ea6e3c81edff30569918e0789e8c1e693b9fc Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-01-16implement create scenario and add unittestSerenaFeng4-4/+107
JIRA: RELENG-163 Change-Id: Id715a2e5de1022cfd0a745505771d250935541bd Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2016-12-23bugfix: access results failed of Test APISerenaFeng1-1/+5
File "/Users/fengxiaowei/opnfv/releng/utils/test/testapi/venv/lib/python2.7/site-packages/opnfv_testapi/resources/models.py", line 47, in format_http return self._format([]) File "/Users/fengxiaowei/opnfv/releng/utils/test/testapi/venv/lib/python2.7/site-packages/opnfv_testapi/resources/models.py", line 37, in _format hs.append(h.format()) AttributeError: 'dict' object has no attribute 'format' JIRA: FUNCTEST-676 Change-Id: I9d8d8a31e5580be51fb690628a03d452742f12d4 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2016-10-18rename result_collection_api to testapiSerenaFeng9-0/+1255
Change-Id: Iec4e3db23cd44f30831e17c127eda74e9d9b5d14 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>