2 Resource ../../common.robot
4 Library RequestsLibrary
5 Library OperatingSystem
9 @{return_ok_list}= 200 201 202 204
10 ${queryswagger_url} /api/vnflcm/v1/swagger.json
11 ${query_vnfs_url} /api/vnflcm/v1/vnf_instances
12 ${healthcheck_url} /api/vnflcm/v1/health_check
15 ${create_vnf_json} ${SCRIPTS}/../tests/vfc/gvnfm-vnflcm/jsoninput/create_vnf.json
22 [Documentation] query swagger info vnflcm by MSB
23 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
24 Create Session web_session http://${VNFLCM_IP}:8801 headers=${headers}
25 ${resp}= GET On Session web_session ${queryswagger_url}
26 ${responese_code}= Convert To String ${resp.status_code}
27 List Should Contain Value ${return_ok_list} ${responese_code}
28 ${response_json} json.loads ${resp.content}
29 ${swagger_version}= Convert To String ${response_json['swagger']}
30 Should Be Equal ${swagger_version} 2.0
33 [Documentation] check health for vnflcm by MSB
34 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
35 Create Session web_session http://${VNFLCM_IP}:8801 headers=${headers}
36 ${resp}= GET On Session web_session ${healthcheck_url}
37 ${responese_code}= Convert To String ${resp.status_code}
38 List Should Contain Value ${return_ok_list} ${responese_code}
39 ${response_json} json.loads ${resp.content}
40 ${health_status}= Convert To String ${response_json['status']}
41 Should Be Equal ${health_status} active
44 [Documentation] check health for vnflcm by MSB
45 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
46 Create Session web_session http://${VNFLCM_IP}:8801 headers=${headers}
47 ${resp}= GET On Session web_session ${query_vnfs_url}
48 ${responese_code}= Convert To String ${resp.status_code}
49 List Should Contain Value ${return_ok_list} ${responese_code}