Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | *** settings *** |
fujinhua | f2490e7 | 2019-04-28 10:32:40 +0800 | [diff] [blame] | 2 | Resource ../../common.robot |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 3 | Library Collections |
| 4 | Library RequestsLibrary |
| 5 | Library OperatingSystem |
| 6 | Library json |
fujinhua | f2490e7 | 2019-04-28 10:32:40 +0800 | [diff] [blame] | 7 | Library HttpLibrary.HTTP |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 8 | |
| 9 | *** Variables *** |
fujinhua | 73c7480 | 2019-04-28 16:27:22 +0800 | [diff] [blame] | 10 | ${catalog_port} 8806 |
Olivia.Zhan | 4881bf3 | 2019-07-11 09:27:06 +0800 | [diff] [blame] | 11 | ${cataloghealthcheck_url} /api/catalog/v1/health_check |
| 12 | ${vnfpkgmhealthcheck_url} /api/vnfpkgm/v1/health_check |
| 13 | ${nsdhealthcheck_url} /api/nsd/v1/health_check |
| 14 | ${parserhealthcheck_url} /api/parser/v1/health_check |
fujinhua | 73c7480 | 2019-04-28 16:27:22 +0800 | [diff] [blame] | 15 | |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 16 | *** Test Cases *** |
Olivia.Zhan | 4881bf3 | 2019-07-11 09:27:06 +0800 | [diff] [blame] | 17 | Check Health Catalog |
| 18 | Log Check Health Catalog |
fujinhua | e23e047 | 2019-04-04 16:24:48 +0800 | [diff] [blame] | 19 | [Documentation] check health for catalog by MSB |
Olivia.Zhan | 4881bf3 | 2019-07-11 09:27:06 +0800 | [diff] [blame] | 20 | Check Health ${cataloghealthcheck_url} |
fujinhua | f2490e7 | 2019-04-28 10:32:40 +0800 | [diff] [blame] | 21 | |
Olivia.Zhan | 4881bf3 | 2019-07-11 09:27:06 +0800 | [diff] [blame] | 22 | Check Health Vnfpkgm |
| 23 | Log Check Health Vnfpkgm |
| 24 | [Documentation] check health for Vnfpkgm by MSB |
| 25 | Check Health ${vnfpkgmhealthcheck_url} |
fujinhua | 73c7480 | 2019-04-28 16:27:22 +0800 | [diff] [blame] | 26 | |
Olivia.Zhan | 4881bf3 | 2019-07-11 09:27:06 +0800 | [diff] [blame] | 27 | Check Health Nsd |
| 28 | Log Check Health Nsd |
| 29 | [Documentation] check health for Nsd by MSB |
| 30 | Check Health ${nsdhealthcheck_url} |
| 31 | |
| 32 | Check Health Parser |
| 33 | Log Check Health Parser |
| 34 | [Documentation] check health for Parser by MSB |
| 35 | Check Health ${parserhealthcheck_url} |
| 36 | |
| 37 | *** Keywords *** |
| 38 | Check Health |
| 39 | [Arguments] ${url} |
fujinhua | 73c7480 | 2019-04-28 16:27:22 +0800 | [diff] [blame] | 40 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
| 41 | Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers} |
Olivia.Zhan | 4881bf3 | 2019-07-11 09:27:06 +0800 | [diff] [blame] | 42 | ${resp}= Get Request web_session ${url} |
| 43 | Should Be Equal As Strings 200 ${resp.status_code} |
| 44 | ${response_json} json.loads ${resp.content} |
| 45 | Should Be Equal As Strings active ${response_json['status']} |