blob: 4bf3d25e71dcfb52efe78c349928d355cc7256ee [file] [log] [blame]
ramu.n519f54d2017-09-16 16:25:35 +05301*** Settings ***
Stilwell, David (stilwelld)eb661132017-10-27 13:40:09 +00002Library Collections
3Library RequestsLibrary
4Library OperatingSystem
5Library json
6Library String
ramu.n519f54d2017-09-16 16:25:35 +05307
8*** Variables ***
Stilwell, David (stilwelld)eb661132017-10-27 13:40:09 +00009${SDN_APIDOCS_URI} /apidoc/apis
10${SDN_HEALTHCHECK_OPERATION_PATH} /operations/SLI-API:healthcheck
11${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} /operations/VNF-API:preload-vnf-topology-operation
ramu.n519f54d2017-09-16 16:25:35 +053012
13*** Test Cases ***
ramu.n519f54d2017-09-16 16:25:35 +053014
Stilwell, David (stilwelld)eb661132017-10-27 13:40:09 +000015Healthcheck API
16 Create Session sdnc http://localhost:8282/restconf
17 ${data}= Get Binary File ${CURDIR}${/}data${/}data.json
18 &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json
19 ${resp}= Post Request sdnc ${SDN_HEALTHCHECK_OPERATION_PATH} data=${data} headers=${headers}
20 Should Be Equal As Strings ${resp.status_code} 200
21 Should Be Equal As Strings ${resp.json()['output']['response-code']} 200
22
23Check SLI-API
24 Create Session sdnc http://localhost:8282
25 &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json
26 ${resp}= Get Request sdnc ${SDN_APIDOCS_URI} headers=${headers}
27 Log ${resp.content}
28 Should Contain ${resp.content} SLI-API
29
30Check VNF-API
31 Create Session sdnc http://localhost:8282
32 &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json
33 ${resp}= Get Request sdnc ${SDN_APIDOCS_URI} headers=${headers}
34 Log ${resp.content}
35 Should Contain ${resp.content} VNF-API
36
37Test Preload
38 Create Session sdnc http://localhost:8282/restconf
39 ${data}= Get Binary File ${CURDIR}${/}data${/}preload.json
40 &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json
41 ${resp}= Post Request sdnc ${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} data=${data} headers=${headers}
42 Log ${resp.content}
43 Should Be Equal As Strings ${resp.status_code} 200
44 Should Be Equal As Strings ${resp.json()['output']['response-code']} 200
ramu.n519f54d2017-09-16 16:25:35 +053045