fujinhua | 79b58a9 | 2017-09-04 19:12:01 +0800 | [diff] [blame] | 1 | *** settings *** |
| 2 | Library Collections |
| 3 | Library RequestsLibrary |
| 4 | Library OperatingSystem |
| 5 | Library json |
| 6 | |
| 7 | *** Variables *** |
| 8 | @{return_ok_list}= 200 201 202 |
| 9 | ${queryswagger_url} /api/nslcm/v1/swagger.json |
| 10 | |
| 11 | *** Test Cases *** |
| 12 | NslcmSwaggerTest |
fujinhua | bbb154e | 2017-09-09 16:29:59 +0800 | [diff] [blame^] | 13 | [Documentation] query swagger info of nslcm |
fujinhua | 8fea9bb | 2017-09-08 09:26:34 +0800 | [diff] [blame] | 14 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
fujinhua | fef3f74 | 2017-09-09 15:55:18 +0800 | [diff] [blame] | 15 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
fujinhua | 8fea9bb | 2017-09-08 09:26:34 +0800 | [diff] [blame] | 16 | ${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 |
fujinhua | bbb154e | 2017-09-09 16:29:59 +0800 | [diff] [blame^] | 22 | |
| 23 | NslcmSwaggerByMSBTest |
| 24 | [Documentation] query swagger info of nslcm by MSB |
| 25 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
| 26 | Create Session web_session http://${MSB_IAG_IP}:80 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 |