blob: 44a4f9d9040e451d2090b661dfff4ef017508dec [file] [log] [blame]
ying.yunlongc9fc0432017-09-12 11:13:01 +08001*** settings ***
2Library Collections
3Library RequestsLibrary
4Library OperatingSystem
5Library json
6
7*** Variables ***
8@{return_ok_list}= 200 201 202
ying.yunlongb058e492017-12-06 15:09:07 +08009${queryswagger_url} /api/ztevnfmdriver/v1/swagger.json
ying.yunlongc9fc0432017-09-12 11:13:01 +080010
11*** Test Cases ***
12VnfresSwaggerTest
ying.yunlongb058e492017-12-06 15:09:07 +080013 [Documentation] query ztevnfmdriver swagger info rest test
ying.yunlongc9fc0432017-09-12 11:13:01 +080014 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
ying.yunlongb058e492017-12-06 15:09:07 +080015 Create Session web_session http://${ZTEVNFMDRIVER_IP}:8410 headers=${headers}
ying.yunlongc9fc0432017-09-12 11:13:01 +080016 ${resp}= Get Request web_session ${queryswagger_url}
17 ${responese_code}= Convert To String ${resp.status_code}
18 List Should Contain Value ${return_ok_list} ${responese_code}
19 ${response_json} json.loads ${resp.content}
20 ${swagger_version}= Convert To String ${response_json['swagger']}
21 Should Be Equal ${swagger_version} 2.0