summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/common
AgeCommit message (Collapse)AuthorFilesLines
2017-10-27bugfix: E722 do not use bare exceptSerenaFeng1-1/+1
new added pep8 check: https://build.opnfv.org/ci/job/testapi-verify-master/435/console Change-Id: I29c1ffbb534babf55ec2fe675001cc85b9e2e922 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-10-23Merge "allow authentication to be disabled"Serena Feng1-1/+2
2017-10-20allow authentication to be disabledSerenaFeng1-1/+2
in local deployment situation, authentication can be disabled by setting authenticate=False of ui section in config.ini JIRA: RELENG-324 Change-Id: I9157d1723851feb12435033dbdd59035e3eb5777 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-10-20criteria field must be 'PASS/FAIL'SerenaFeng2-0/+17
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-12leverage LFID authentication to pod creationSerenaFeng2-0/+25
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-5/+2
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-1/+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-06hide cas ticket from web portalSerenaFeng2-36/+0
In the previous implementation, when login the url will shown as: http://localhost:8000/?ticket=ST-5WzYs6SD2A#/ this patch aims to hide the ticket mechanism. 1) add /api/v1/auth/signin_return to process login verify 2) refactor code, leverage SignBaseHanlder() to manage casclient Change-Id: I62e23eb69ee52304c30753e861b4f0a4e0d45541 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-09-05Merge "bugfix: leverage data_files to stop hacking setup.py"Serena Feng1-4/+0
2017-09-05bugfix: container start failed due to config_file set to NonetypeSerenaFeng1-1/+1
Traceback (most recent call last): File "/usr/local/bin/opnfv-testapi", line 6, in <module> from opnfv_testapi.cmd.server import main File "/usr/local/lib/python2.7/dist-packages/opnfv_testapi/cmd/server.py", line 34, in <module> from opnfv_testapi.common.config import CONF File "/usr/local/lib/python2.7/dist-packages/opnfv_testapi/common/config.py", line 67, in <module> CONF = Config() File "/usr/local/lib/python2.7/dist-packages/opnfv_testapi/common/config.py", line 21, in __init__ self._parse() File "/usr/local/lib/python2.7/dist-packages/opnfv_testapi/common/config.py", line 29, in _parse if not os.path.exists(self.config_file): File "/usr/lib/python2.7/genericpath.py", line 18, in exists os.stat(path) TypeError: coercing to Unicode: need string or buffer, NoneType found Change-Id: Ifa26b5b52e7f1c19a773b02ecc1c45b59b5dc09b Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-09-04bugfix: leverage data_files to stop hacking setup.pySerenaFeng1-4/+0
1) leverage data_files to distribute ui related files, and dispatch them under /usr/local/share/opnfv_testapi 2) delete hacking coding, no more extra processes 3) utilize MANIFEST.in to include 3rd_party when producing a source distribution Change-Id: Idb83a02be11f6b24610191e9f85e0db80d92e972 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-09-04improve: discard venv support for official productSerenaFeng1-13/+2
virtual env is only to facilitate the development, not be used in official product, thus delete the support, let the developer manage their own development env. Change-Id: I33af882ab257e88b1e7a316d1d78197d6279933d Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-08-31leverage LFID as AuthenticationSerenaFeng2-0/+40
delete openid authentication add LFID authentication Change-Id: Iead144b5130bce51448024e65092fdea3bb2f07a Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-08-21update projects in scenarioSerenaFeng1-0/+4
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-07-21separate db methods from handler.pySerenaFeng1-5/+6
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.pySerenaFeng1-9/+27
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-0/+4
1. add role for user 2. user can upload test results Change-Id: I1c5370be7818edb0394f05e8b81f975deb98b286 Signed-off-by: grakiss <grakiss.wanglei@huawei.com>
2017-06-20support pagination in TestAPISerenaFeng1-0/+5
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-19bugfix: extra fields are added when push resultsSerenaFeng1-3/+3
extra fields like 'carriers' & 'miss_checks' 'db_key' are added when pushing result to TestDB Change-Id: Ic8d0751bca14b3b3260df42c0f4f07456c9d5e05 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-05-17refactor static_path to accomodate web portalSerenaFeng1-0/+4
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-71/+29
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-10correct the import impl of TestAPISerenaFeng1-2/+4
Change-Id: Ia721ff61e02b1819c32d228f5f8910364c139c8a Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-04-09unify data existence checkSerenaFeng1-0/+111
Change-Id: I2ee4c3be6f34ce12530450cd22f2561c458685f9 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-04-06unify error message in TestAPISerenaFeng2-0/+54
Change-Id: I994feb7bf340c9e48bebe9fdf3dc3a76bc254652 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-03-30unify raise exception processSerenaFeng1-0/+31
Change-Id: I109ef9550a57e218b6f5c9196812b33133d34134 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-03-30replace self-defined http codes with standard definitionsSerenaFeng1-16/+0
Change-Id: I3045dc690e0bc1186f5c548cb533462dd03130d9 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-03-23start TestAPI in venv with no config-fileSerenaFeng1-2/+7
in virtual env mode, config.ini is configured in .venv/etc/opnfv_testapi, in this case when we start it the configuration file needs to be specified, by changing the _default_config, the -config-file is no longer needed when starting TestAPI in venv mode. Change-Id: I0217cfefe578bbc3325bb7577ed268dc21cde4ea Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-02-27Use new-style classes which inherit from object in TestAPISerenaFeng1-1/+1
JIRA: FUNCTEST-707 Change-Id: I90a3d6ebfdf798eefccb8e5a0deebb661329d903 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-02-24add unittest of config.pySerenaFeng1-17/+7
Change-Id: I96639c47d27ef449d02528efad23e2499daa3def Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
2017-02-21Add token based authentication for post/update/deleterohitsakala2-0/+6
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 TestAPISerenaFeng1-5/+3
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>
2016-10-18rename result_collection_api to testapiSerenaFeng3-0/+118
Change-Id: Iec4e3db23cd44f30831e17c127eda74e9d9b5d14 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>