blob: b83bee47ad1e9b706718a62485e4620bed9257f1 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001*** 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
fujinhuae23e0472019-04-04 16:24:48 +080012${healthcheck_url} /api/catalog/v1/health_check
Gary Wu9abb61c2018-09-27 10:38:50 -070013
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}
fujinhuae23e0472019-04-04 16:24:48 +080021
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