summaryrefslogtreecommitdiffstats
path: root/tests/sdnc
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-09-27 10:38:50 -0700
committerGary Wu <gary.i.wu@huawei.com>2018-09-27 10:39:43 -0700
commit9abb61ca2cea1907cab2cec312d6dca6e53a93cd (patch)
treec8ff0718b6626832efd3ff3acc48590dbd6cb64c /tests/sdnc
parenta328a3e2e531240ea4a9ed2ce4a284af1be5e225 (diff)
Move CSIT to integration/csit repo
To facilite branching of CSIT tests, all CSIT test code and scripts are relocated to the integration/csit repo. Change-Id: I1e4c0eff44691f73f8098b3c52764107f6b8b8df Issue-ID: INT-671 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'tests/sdnc')
-rw-r--r--tests/sdnc/healthcheck/__init__.robot2
-rw-r--r--tests/sdnc/healthcheck/data/data.json4
-rw-r--r--tests/sdnc/healthcheck/data/preload.json41
-rw-r--r--tests/sdnc/healthcheck/test1.robot44
4 files changed, 91 insertions, 0 deletions
diff --git a/tests/sdnc/healthcheck/__init__.robot b/tests/sdnc/healthcheck/__init__.robot
new file mode 100644
index 00000000..8dac1b6a
--- /dev/null
+++ b/tests/sdnc/healthcheck/__init__.robot
@@ -0,0 +1,2 @@
+*** Settings ***
+Documentation SDNC - healthcheck
diff --git a/tests/sdnc/healthcheck/data/data.json b/tests/sdnc/healthcheck/data/data.json
new file mode 100644
index 00000000..583e26fb
--- /dev/null
+++ b/tests/sdnc/healthcheck/data/data.json
@@ -0,0 +1,4 @@
+{
+ "input" : {
+ }
+}
diff --git a/tests/sdnc/healthcheck/data/preload.json b/tests/sdnc/healthcheck/data/preload.json
new file mode 100644
index 00000000..b53afa85
--- /dev/null
+++ b/tests/sdnc/healthcheck/data/preload.json
@@ -0,0 +1,41 @@
+{
+ "input": {
+ "vnf-topology-information": {
+ "vnf-topology-identifier": {
+ "service-type": "robot_demo",
+ "vnf-name": "vf_robot_module",
+ "vnf-type": "vf_robot_type",
+ "generic-vnf-name": "generic_vnf_name",
+ "generic-vnf-type": "generic_vnf_type"
+ },
+ "vnf-assignments": {
+ "availability-zones": [],
+ "vnf-networks": [],
+ "vnf-vms": []
+ },
+ "vnf-parameters": [
+ {
+ "vnf-parameter-name": "ngm1_management_ip_0",
+ "vnf-parameter-value":"127.0.0.1"
+ },
+ {
+ "vnf-parameter-name": "ngm2_management_ip_1",
+ "vnf-parameter-value":"127.0.0.2"
+ }
+ ]
+ },
+ "request-information": {
+ "request-id": "robot12",
+ "order-version": "1",
+ "notification-url": "openecomp.org",
+ "order-number": "1",
+ "request-action": "PreloadVNFRequest"
+ },
+ "sdnc-request-header": {
+ "svc-request-id": "robot12",
+ "svc-notification-url": "http:\/\/openecomp.org:8080\/adapters\/rest\/SDNCNotify",
+ "svc-action": "reserve"
+ }
+ }
+}
+
diff --git a/tests/sdnc/healthcheck/test1.robot b/tests/sdnc/healthcheck/test1.robot
new file mode 100644
index 00000000..c002a189
--- /dev/null
+++ b/tests/sdnc/healthcheck/test1.robot
@@ -0,0 +1,44 @@
+*** Settings ***
+Library Collections
+Library RequestsLibrary
+Library OperatingSystem
+Library json
+Library String
+
+*** Variables ***
+${SDN_APIDOCS_URI} /apidoc/apis
+${SDN_HEALTHCHECK_OPERATION_PATH} /operations/SLI-API:healthcheck
+${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} /operations/VNF-API:preload-vnf-topology-operation
+
+*** Test Cases ***
+
+Healthcheck API
+ Create Session sdnc http://localhost:8282/restconf
+ ${data}= Get File ${CURDIR}${/}data${/}data.json
+ &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json
+ ${resp}= Post Request sdnc ${SDN_HEALTHCHECK_OPERATION_PATH} data=${data} headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Be Equal As Strings ${resp.json()['output']['response-code']} 200
+
+Check SLI-API
+ Create Session sdnc http://localhost:8282
+ &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json
+ ${resp}= Get Request sdnc ${SDN_APIDOCS_URI} headers=${headers}
+ Log ${resp.text}
+ Should Contain ${resp.text} SLI-API
+
+Check VNF-API
+ Create Session sdnc http://localhost:8282
+ &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json
+ ${resp}= Get Request sdnc ${SDN_APIDOCS_URI} headers=${headers}
+ Log ${resp.text}
+ Should Contain ${resp.text} VNF-API
+
+Test Preload
+ Create Session sdnc http://localhost:8282/restconf
+ ${data}= Get File ${CURDIR}${/}data${/}preload.json
+ &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json
+ ${resp}= Post Request sdnc ${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} data=${data} headers=${headers}
+ Log ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Be Equal As Strings ${resp.json()['output']['response-code']} 200