blob: b83bee47ad1e9b706718a62485e4620bed9257f1 [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
9${queryswagger_url} /api/catalog/v1/swagger.json
10${queryVNFPackage_url} /api/catalog/v1/vnfpackages
11${queryNSPackages_url} /api/catalog/v1/nspackages
12${healthcheck_url} /api/catalog/v1/health_check
13
14*** Test Cases ***
15GetVNFPackages
16 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
17 Create Session web_session http://${CATALOG_IP}:8806 headers=${headers}
18 ${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
22CatalogHealthCheckTest
23 [Documentation] check health for catalog by MSB
24 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
25 Create Session web_session http://${CATALOG_IP}:8806 headers=${headers}
26 ${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