blob: 97463ac105947afa0799dfb0d2b5aea0376b69af [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001*** settings ***
2Resource ../../common.robot
3Library Collections
4Library RequestsLibrary
5Library OperatingSystem
6Library json
7Library HttpLibrary.HTTP
8
9*** Variables ***
10@{return_ok_list}= 200 201 202 204
11${queryswagger_url} /api/vnflcm/v1/swagger.json
12${create_vnf_url} /api/vnflcm/v1/vnf_instances
13${delete_vnf_url} /api/vnflcm/v1/vnf_instances
fujinhuaba33cc42019-04-04 09:01:32 +080014${healthcheck_url} /api/vnflcm/v1/health_check
Gary Wu9abb61c2018-09-27 10:38:50 -070015
16#json files
17${create_vnf_json} ${SCRIPTS}/../tests/vfc/gvnfm-vnflcm/jsoninput/create_vnf.json
18
19#global variables
20${vnfInstId}
21
22*** Test Cases ***
23VnflcmSwaggerTest
24 [Documentation] query swagger info vnflcm by MSB
25 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
26 Create Session web_session http://${VNFLCM_IP}:8801 headers=${headers}
27 ${resp}= Get Request web_session ${queryswagger_url}
28 ${responese_code}= Convert To String ${resp.status_code}
29 List Should Contain Value ${return_ok_list} ${responese_code}
30 ${response_json} json.loads ${resp.content}
31 ${swagger_version}= Convert To String ${response_json['swagger']}
32 Should Be Equal ${swagger_version} 2.0
fujinhuaba33cc42019-04-04 09:01:32 +080033
34VnflcmHealthCheckTest
35 [Documentation] check health for vnflcm by MSB
36 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
37 Create Session web_session http://${VNFLCM_IP}:8801 headers=${headers}
38 ${resp}= Get Request web_session ${healthcheck_url}
39 ${responese_code}= Convert To String ${resp.status_code}
40 List Should Contain Value ${return_ok_list} ${responese_code}
41 ${response_json} json.loads ${resp.content}
42 ${health_status}= Convert To String ${response_json['status']}
43 Should Be Equal ${health_status} active