blob: 3648a8e4da7863ca6b92bccf9e74da48b3c14ebd [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001*** Settings ***
2Library Collections
3Library RequestsLibrary
4Library OperatingSystem
5Library json
6Library String
7
8*** Variables ***
9${SDN_APIDOCS_URI} /apidoc/apis
10${SDN_HEALTHCHECK_OPERATION_PATH} /operations/SLI-API:healthcheck
Gary Wu9abb61c2018-09-27 10:38:50 -070011
12*** Test Cases ***
13
14Healthcheck 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
22Check 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