Add Functional test case 11/21011/1
authorStilwell, David (stilwelld) <stilwelld@att.com>
Fri, 27 Oct 2017 13:40:09 +0000 (13:40 +0000)
committerStilwell, David (stilwelld) <stilwelld@att.com>
Fri, 27 Oct 2017 13:40:37 +0000 (13:40 +0000)
Added Functional test case : validate vnf-api
Added additional sleep to setup.sh
Updated teardown to dmaap container cleanup

Change-Id: I7586d0526053baa24a36d9da371d20239abb76b4
Issue-ID: SDNC-84
Signed-off-by: Stilwell, David (stilwelld) <stilwelld@att.com>
test/csit/plans/sdnc/healthcheck/setup.sh
test/csit/plans/sdnc/healthcheck/teardown.sh
test/csit/tests/sdnc/healthcheck/data/data.json [new file with mode: 0644]
test/csit/tests/sdnc/healthcheck/data/preload.json [new file with mode: 0644]
test/csit/tests/sdnc/healthcheck/test1.robot

index 5359026..5e51b0e 100644 (file)
@@ -120,6 +120,9 @@ if [ "$num_failed_bundles" -ge 1 ]; then
   echo "  $failed_bundles"
 fi
 
+# Sleep additional 120 to give application time to finish
+sleep 120
+
 # Pass any variables required by Robot test suites in ROBOT_VARIABLES
 ROBOT_VARIABLES="-v SCRIPTS:${SCRIPTS}"
 
index 4d99b9f..925e7b7 100644 (file)
@@ -21,5 +21,6 @@ kill-instance.sh sdnc_controller_container
 kill-instance.sh sdnc_dgbuilder_container
 kill-instance.sh sdnc_portal_container
 kill-instance.sh sdnc_db_container
+kill-instance.sh sdnc_ueblistener_container
 
 # $WORKSPACE/archives/appc deleted with archives folder when tests starts so we keep it at the end for debugging
diff --git a/test/csit/tests/sdnc/healthcheck/data/data.json b/test/csit/tests/sdnc/healthcheck/data/data.json
new file mode 100644 (file)
index 0000000..583e26f
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "input" : {
+  }
+}
diff --git a/test/csit/tests/sdnc/healthcheck/data/preload.json b/test/csit/tests/sdnc/healthcheck/data/preload.json
new file mode 100644 (file)
index 0000000..b53afa8
--- /dev/null
@@ -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"
+        }
+    }
+}
+
index 1adb9a6..4bf3d25 100644 (file)
@@ -1,16 +1,45 @@
 *** Settings ***
-Library           OperatingSystem
-Library           Process
+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
 
-${health_check}    ${SCRIPTS}/health_check.sh
+*** Test Cases ***
 
+Healthcheck API
+    Create Session   sdnc  http://localhost:8282/restconf
+    ${data}=    Get Binary 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.content}
+    Should Contain    ${resp.content}    SLI-API  
 
-*** Test Cases ***
-Health check test case for SDNC
-    [Documentation]   Health check
-    ${result_hc}=    Run Process   bash ${health_check} > log_hc.txt    shell=yes
-    Should Be Equal As Integers    ${result_hc.rc}    0
+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.content}
+    Should Contain    ${resp.content}    VNF-API
 
+Test Preload
+    Create Session   sdnc  http://localhost:8282/restconf
+    ${data}=    Get Binary 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.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Be Equal As Strings  ${resp.json()['output']['response-code']}   200