blob: b3da1c0d75d09be9c7062509253cd5d89805f2b5 [file] [log] [blame]
yangyandbb0fca2019-04-22 14:57:16 +08001*** settings ***
2Library Collections
3Library RequestsLibrary
4Library OperatingSystem
5Library json
6
7*** Variables ***
8@{return_ok_list}= 200 201 202
yangyan01d879b2019-05-05 16:11:49 +08009${queryswagger_url} /api/parser/v1/swagger.json
yangyan5f6b5682019-04-26 09:21:58 +080010${queryVNFPackage_url} /api/parser/v1/vnfpackages
11${queryNSPackages_url} /api/parser/v1/nspackages
12${healthcheck_url} /api/parser/v1/health_check
yangyandbb0fca2019-04-22 14:57:16 +080013
14*** Test Cases ***
15GetVNFPackages
16 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
yangyan5f6b5682019-04-26 09:21:58 +080017 Create Session web_session http://${GenericParser_IP}:8806 headers=${headers}
yangyandbb0fca2019-04-22 14:57:16 +080018 ${resp}= Get Request web_session ${queryVNFPackage_url}
19 ${responese_code}= Convert To String ${resp.status_code}
20 List Should Contain Value ${return_ok_list} ${responese_code}
21
yangyan5f6b5682019-04-26 09:21:58 +080022HealthCheckTest
yangyandbb0fca2019-04-22 14:57:16 +080023 [Documentation] check health for catalog by MSB
24 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
yangyan5f6b5682019-04-26 09:21:58 +080025 Create Session web_session http://${GenericParser_IP}:8806 headers=${headers}
yangyandbb0fca2019-04-22 14:57:16 +080026 ${resp}= Get Request web_session ${healthcheck_url}
27 ${responese_code}= Convert To String ${resp.status_code}
28 List Should Contain Value ${return_ok_list} ${responese_code}
29 ${response_json} json.loads ${resp.content}
30 ${health_status}= Convert To String ${response_json['status']}
31 Should Be Equal ${health_status} active