blob: 6498de115ff8a86c56419631fd164b1d7d2ae8db [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001*** settings ***
2Library Collections
3Library RequestsLibrary
4Library OperatingSystem
5Library json
6
7*** Variables ***
8@{return_ok_list}= 200 201 202
9${queryswagger_url} /api/vnfres/v1/swagger.json
fujinhua8ba19f32019-04-04 12:10:57 +080010${healthcheck_url} /api/vnfres/v1/health_check
Gary Wu9abb61c2018-09-27 10:38:50 -070011
12*** Test Cases ***
13VnfresSwaggerTest
14 [Documentation] query vnfres swagger info rest test
15 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
16 Create Session web_session http://${VNFRES_IP}:8802 headers=${headers}
17 ${resp}= Get Request web_session ${queryswagger_url}
18 ${responese_code}= Convert To String ${resp.status_code}
19 List Should Contain Value ${return_ok_list} ${responese_code}
20 ${response_json} json.loads ${resp.content}
21 ${swagger_version}= Convert To String ${response_json['swagger']}
22 Should Be Equal ${swagger_version} 2.0
fujinhua8ba19f32019-04-04 12:10:57 +080023
24VnfResHealthCheckTest
25 [Documentation] check health for vnfres by MSB
26 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
27 Create Session web_session http://${VNFRES_IP}:8802 headers=${headers}
28 ${resp}= Get Request web_session ${healthcheck_url}
29 ${responese_code}= Convert To String ${resp.status_code}
30 List Should Contain Value ${return_ok_list} ${responese_code}
31 ${response_json} json.loads ${resp.content}
32 ${health_status}= Convert To String ${response_json['status']}
33 Should Be Equal ${health_status} active