blob: 773d83a136565e3a4e2723c62c01979dffd2de45 [file] [log] [blame]
fujinhuafafc9222019-04-04 15:17:31 +08001*** settings ***
2Library Collections
3Library RequestsLibrary
4Library OperatingSystem
5Library json
6
7*** Variables ***
8@{return_ok_list}= 200 201 202
9${queryswagger_url} /api/vnfmgr/v1/swagger.json
10${healthcheck_url} /api/vnfmgr/v1/health_check
11
12*** Test Cases ***
13VnfMgrSwaggerTest
14 [Documentation] query vnfmgr swagger info rest test
15 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
16 Create Session web_session http://${VNFMGR_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
23
24VnfMgrHealthCheckTest
25 [Documentation] check health for vnfmgr by MSB
26 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
27 Create Session web_session http://${VNFMGR_IP}:8803 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