Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | *** settings *** |
| 2 | Library Collections |
| 3 | Library RequestsLibrary |
| 4 | Library OperatingSystem |
| 5 | Library 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 |
fujinhua | e23e047 | 2019-04-04 16:24:48 +0800 | [diff] [blame^] | 12 | ${healthcheck_url} /api/catalog/v1/health_check |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 13 | |
| 14 | *** Test Cases *** |
| 15 | GetVNFPackages |
| 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} |
fujinhua | e23e047 | 2019-04-04 16:24:48 +0800 | [diff] [blame^] | 21 | |
| 22 | CatalogHealthCheckTest |
| 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 |