yangyan | dbb0fca | 2019-04-22 14:57:16 +0800 | [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 |
yangyan | 01d879b | 2019-05-05 16:11:49 +0800 | [diff] [blame] | 9 | ${queryswagger_url} /api/parser/v1/swagger.json |
yangyan | 5f6b568 | 2019-04-26 09:21:58 +0800 | [diff] [blame] | 10 | ${queryVNFPackage_url} /api/parser/v1/vnfpackages |
| 11 | ${queryNSPackages_url} /api/parser/v1/nspackages |
| 12 | ${healthcheck_url} /api/parser/v1/health_check |
yangyan | dbb0fca | 2019-04-22 14:57:16 +0800 | [diff] [blame] | 13 | |
| 14 | *** Test Cases *** |
| 15 | GetVNFPackages |
| 16 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
yangyan | 5f6b568 | 2019-04-26 09:21:58 +0800 | [diff] [blame] | 17 | Create Session web_session http://${GenericParser_IP}:8806 headers=${headers} |
yangyan | dbb0fca | 2019-04-22 14:57:16 +0800 | [diff] [blame] | 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 | |
yangyan | 5f6b568 | 2019-04-26 09:21:58 +0800 | [diff] [blame] | 22 | HealthCheckTest |
yangyan | dbb0fca | 2019-04-22 14:57:16 +0800 | [diff] [blame] | 23 | [Documentation] check health for catalog by MSB |
| 24 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
yangyan | 5f6b568 | 2019-04-26 09:21:58 +0800 | [diff] [blame] | 25 | Create Session web_session http://${GenericParser_IP}:8806 headers=${headers} |
yangyan | dbb0fca | 2019-04-22 14:57:16 +0800 | [diff] [blame] | 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 |