Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Library Collections |
| 3 | Library RequestsLibrary |
| 4 | Library OperatingSystem |
| 5 | Library json |
| 6 | Library String |
| 7 | |
| 8 | *** Variables *** |
| 9 | ${SDN_APIDOCS_URI} /apidoc/apis |
| 10 | ${SDN_HEALTHCHECK_OPERATION_PATH} /operations/SLI-API:healthcheck |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 11 | |
| 12 | *** Test Cases *** |
| 13 | |
| 14 | Healthcheck API |
| 15 | Create Session sdnc http://localhost:8282/restconf |
| 16 | ${data}= Get File ${CURDIR}${/}data${/}data.json |
| 17 | &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json |
| 18 | ${resp}= Post Request sdnc ${SDN_HEALTHCHECK_OPERATION_PATH} data=${data} headers=${headers} |
| 19 | Should Be Equal As Strings ${resp.status_code} 200 |
| 20 | Should Be Equal As Strings ${resp.json()['output']['response-code']} 200 |
| 21 | |
| 22 | Check SLI-API |
| 23 | Create Session sdnc http://localhost:8282 |
| 24 | &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json |
| 25 | ${resp}= Get Request sdnc ${SDN_APIDOCS_URI} headers=${headers} |
| 26 | Log ${resp.text} |
| 27 | Should Contain ${resp.text} SLI-API |