blob: 1390e9fbdcf17ff906e972cc29970a71a0b24108 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001*** settings ***
fujinhuaf2490e72019-04-28 10:32:40 +08002Resource ../../common.robot
Gary Wu9abb61c2018-09-27 10:38:50 -07003Library Collections
4Library RequestsLibrary
5Library OperatingSystem
6Library json
fujinhuaf2490e72019-04-28 10:32:40 +08007Library HttpLibrary.HTTP
Gary Wu9abb61c2018-09-27 10:38:50 -07008
9*** Variables ***
fujinhua73c74802019-04-28 16:27:22 +080010${catalog_port} 8806
Olivia.Zhan4881bf32019-07-11 09:27:06 +080011${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
fujinhua73c74802019-04-28 16:27:22 +080015
Gary Wu9abb61c2018-09-27 10:38:50 -070016*** Test Cases ***
Olivia.Zhan4881bf32019-07-11 09:27:06 +080017Check Health Catalog
18 Log Check Health Catalog
fujinhuae23e0472019-04-04 16:24:48 +080019 [Documentation] check health for catalog by MSB
Olivia.Zhan4881bf32019-07-11 09:27:06 +080020 Check Health ${cataloghealthcheck_url}
fujinhuaf2490e72019-04-28 10:32:40 +080021
Olivia.Zhan4881bf32019-07-11 09:27:06 +080022Check Health Vnfpkgm
23 Log Check Health Vnfpkgm
24 [Documentation] check health for Vnfpkgm by MSB
25 Check Health ${vnfpkgmhealthcheck_url}
fujinhua73c74802019-04-28 16:27:22 +080026
Olivia.Zhan4881bf32019-07-11 09:27:06 +080027Check Health Nsd
28 Log Check Health Nsd
29 [Documentation] check health for Nsd by MSB
30 Check Health ${nsdhealthcheck_url}
31
32Check Health Parser
33 Log Check Health Parser
34 [Documentation] check health for Parser by MSB
35 Check Health ${parserhealthcheck_url}
36
37*** Keywords ***
38Check Health
39 [Arguments] ${url}
fujinhua73c74802019-04-28 16:27:22 +080040 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
41 Create Session web_session http://${CATALOG_IP}:${catalog_port} headers=${headers}
Olivia.Zhan4881bf32019-07-11 09:27:06 +080042 ${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']}