ramu.n | 519f54d | 2017-09-16 16:25:35 +0530 | [diff] [blame] | 1 | *** Settings *** |
Stilwell, David (stilwelld) | eb66113 | 2017-10-27 13:40:09 +0000 | [diff] [blame] | 2 | Library Collections |
| 3 | Library RequestsLibrary |
| 4 | Library OperatingSystem |
| 5 | Library json |
| 6 | Library String |
ramu.n | 519f54d | 2017-09-16 16:25:35 +0530 | [diff] [blame] | 7 | |
| 8 | *** Variables *** |
Stilwell, David (stilwelld) | eb66113 | 2017-10-27 13:40:09 +0000 | [diff] [blame] | 9 | ${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.n | 519f54d | 2017-09-16 16:25:35 +0530 | [diff] [blame] | 12 | |
| 13 | *** Test Cases *** |
ramu.n | 519f54d | 2017-09-16 16:25:35 +0530 | [diff] [blame] | 14 | |
Stilwell, David (stilwelld) | eb66113 | 2017-10-27 13:40:09 +0000 | [diff] [blame] | 15 | Healthcheck API |
| 16 | Create Session sdnc http://localhost:8282/restconf |
Matej Klotton | f45cf26 | 2018-09-12 10:03:12 +0200 | [diff] [blame] | 17 | ${data}= Get File ${CURDIR}${/}data${/}data.json |
Stilwell, David (stilwelld) | eb66113 | 2017-10-27 13:40:09 +0000 | [diff] [blame] | 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 |
Matej Klotton | f45cf26 | 2018-09-12 10:03:12 +0200 | [diff] [blame] | 22 | |
Stilwell, David (stilwelld) | eb66113 | 2017-10-27 13:40:09 +0000 | [diff] [blame] | 23 | Check 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} |
Matej Klotton | f45cf26 | 2018-09-12 10:03:12 +0200 | [diff] [blame] | 27 | Log ${resp.text} |
| 28 | Should Contain ${resp.text} SLI-API |
Stilwell, David (stilwelld) | eb66113 | 2017-10-27 13:40:09 +0000 | [diff] [blame] | 29 | |
| 30 | Check 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} |
Matej Klotton | f45cf26 | 2018-09-12 10:03:12 +0200 | [diff] [blame] | 34 | Log ${resp.text} |
| 35 | Should Contain ${resp.text} VNF-API |
Stilwell, David (stilwelld) | eb66113 | 2017-10-27 13:40:09 +0000 | [diff] [blame] | 36 | |
| 37 | Test Preload |
| 38 | Create Session sdnc http://localhost:8282/restconf |
Matej Klotton | f45cf26 | 2018-09-12 10:03:12 +0200 | [diff] [blame] | 39 | ${data}= Get File ${CURDIR}${/}data${/}preload.json |
Stilwell, David (stilwelld) | eb66113 | 2017-10-27 13:40:09 +0000 | [diff] [blame] | 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} |
Matej Klotton | f45cf26 | 2018-09-12 10:03:12 +0200 | [diff] [blame] | 42 | Log ${resp.text} |
Stilwell, David (stilwelld) | eb66113 | 2017-10-27 13:40:09 +0000 | [diff] [blame] | 43 | Should Be Equal As Strings ${resp.status_code} 200 |
| 44 | Should Be Equal As Strings ${resp.json()['output']['response-code']} 200 |