summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/tests/unit/resources
AgeCommit message (Collapse)AuthorFilesLines
2017-10-27divide resources into handlers and modelsSerenaFeng12-1844/+0
divide resources into handlers&models put ui handlers into handlers directory put User into user_models.py Change-Id: I3d9e260097205213c3ea8d4eac08b9019e017f71 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-10-20criteria field must be 'PASS/FAIL'SerenaFeng1-1/+8
criteria must be fix with 'PASS/FAIL', case insensitive or else, BADREQUEST exception will be raises JIRA: RELENG-327 Change-Id: Ic648b9d38937fc63924e42cfdf5345cdaa32e1ed Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-09-18Bug Fix: Using library for urlencodeutkarshrai981-19/+18
Changes to method call _set_query Change-Id: I95837df57cc98c21ff5d95d9753269490c025dd3 Signed-off-by: utkarshrai98 <utkarshrai98@gmail.com>
2017-09-12leverage LFID authentication to pod creationSerenaFeng3-22/+65
only valid linux foundation user is allowed to create the new pod add owner field in pods to track the pod creator Change-Id: Icada07152069f7c826bfa6122cb86db8c4e3bf68 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-09-12leverage token_check only when posting resultsSerenaFeng1-68/+6
In this patch begin to consider the LFID authentication, token check only effects results, the permission of other resources(pods/projects...) will be checked by LFID. Change-Id: I20f6f221e3bd75ebf06dcd91012898b913f1d0be Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-09-11add case-insensitive for find pods querythuva41-0/+7
Now user can't create the pods with the same name. Just like "Demo" , "deMo" and "demo" Add unit test for case-insensitive query Change-Id: Ifddc7b70a38d8504e5fe105fa5cc1a77bf0e39a9 Signed-off-by: thuva4 <tharma.thuva@gmail.com>
2017-09-04clarify obsoleted test configuration filesSerenaFeng1-4/+2
delete noparam.ini/nosection.ini/notboolean.ini/notint.ini/normal.ini substitute normal.ini with etc/config.ini Change-Id: I7e2fa331736a2f9bf807814416a3118be5f613e5 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-08-25update scenario nameSerenaFeng1-0/+17
url PUT /api/v1/scenarios/<scenario_name> if new_name already exist, return Forbidden if new_name == name, return Forbidden Change-Id: If3b82b3df4a763d60dad110caca2659c5f39ab50 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-08-25update installer under scenarioSerenaFeng1-9/+58
1. post, add one or more new installers 2. update, replace existed installers as a totality 3. delete, delete one or more installers by name 4. in post&update, if schema is not consistent with ScenarioInstaller model, BadRequest will be raised(only extra keys will be detected currently) 5. in post, if installer already exist, return Conflict with already exist message 6. in update, if a installer appears more than once, also return Conflict with already exist message Change-Id: I830dba3bcf5f1a9d1c93513b4aae59009f69dc8f Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-08-25simplify unit tests implementation of update scenarioSerenaFeng1-88/+79
1. delete useless input arguments 2. update on and assert with self.req_d directly delete intermediate variable 'scenario' Change-Id: I3eda1df4893c890bb23ccf05b45ce2de5fa9dd93 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-08-25update versions under scenarioSerenaFeng1-0/+68
1. post, add one or more new versions 2. update, replace existed version as a totality 3. delete, delete one or more versions by name 4. in post&update, if schema is not consistent with ScenarioVersion model, BadRequest will be raised(only extra keys will be detected currently) 5. in post, if project already exist, return Conflict with already exist message 6. in update, if a version appears more than once, also return Conflict with already exist message 7. add update with conflict unittest for projects Change-Id: I0d2c8a5567f3abce7b0313a64e18303af02cc002 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-08-24bugfix: fail to generate APIs documentSerenaFeng1-1/+2
Change-Id: I13c91fb34e190cd62400eccec6b755419aad89d1 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-08-23bugfix: malfunction of scenario equal checkSerenaFeng2-5/+4
1. bugfix equal check with[] will return list[false, true], and always True in next step check 2. in assert_res() leverage '==' will never assert even if they are not equal Change-Id: I683e3489d45b98b508f8ab8b6ef268ca9a1ebd5f Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-08-21change scenario ownerSerenaFeng1-1/+8
1 bugfix owner must be explicit in ScenarioVersion model 2 change owner of scenario 3. usage: PUT /api/v1/scenarios/<scenario_name>/owner? \ installer=<installer_name>& \ version=<version_name> body: new owner Change-Id: I261468cd8445030b61e37e0f804b699d6205bdb0 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-08-21update projects in scenarioSerenaFeng1-4/+69
1. post, add one or more new projects 2. update, replace existed projects wholly 3. delete, delete one or more projects by name 4. in post&update, if schema is not consistent with ScenarioProject model, BadRequest will be raised(only extra keys will be detected currently) 5. in post, if project already exist, return Conflict with already exist message Change-Id: Iead585f787a4acc61abce6c9d38a036739b498d6 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
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-21separate db methods from handler.pySerenaFeng1-6/+2
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.pySerenaFeng3-18/+19
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 uploadgrakiss1-4/+44
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 Feng1-4/+22
2017-07-19bugfix: query doesn't work well with period=1SerenaFeng1-4/+22
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-0/+1685
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>