Add Metadata tests for PM Mapper 16/78916/2
authorJoeOLeary <joseph.o.leary@est.tech>
Mon, 25 Feb 2019 10:14:53 +0000 (10:14 +0000)
committerJoeOLeary <joseph.o.leary@est.tech>
Mon, 25 Feb 2019 10:14:53 +0000 (10:14 +0000)
Change-Id: I6f0904e1b3e10fd1c9fe41020898380e1fb50141
Issue-ID: INT-863
Signed-off-by: JoeOLeary <joseph.o.leary@est.tech>
plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-pmmapper.yml
tests/dcaegen2-pmmapper/pmmapper/__init__.robot
tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot

index de64b80..0833dfe 100644 (file)
@@ -3,6 +3,8 @@ services:
   pmmapper:
     container_name: pmmapper
     image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pm-mapper:1.0-SNAPSHOT
+    ports:
+     - "8081:8081"
     environment:
        CONFIG_BINDING_SERVICE_SERVICE_HOST: CBSIP
        CONFIG_BINDING_SERVICE_SERVICE_PORT: 10000
index 7114fd4..3e4501c 100644 (file)
@@ -1,2 +1,2 @@
 *** Settings ***
-Documentation    5G Bulk PM E2E Testcases
+Documentation    PM Mapper Testcases
index 1e3d9e9..a05defb 100644 (file)
@@ -5,10 +5,15 @@ Library           OperatingSystem
 Library           RequestsLibrary
 Library           Process
 
+Test Setup        Create Session  mapper_session  ${PMMAPPER_BASE_URL}
+Test Teardown     Delete All Sessions
+
 
 *** Variables ***
 ${CLI_EXEC_CLI_CONFIG}                   { head -n 5 | tail -1;} < /tmp/pmmapper.log
 ${CLI_EXEC_CLI_SUBS}                     curl -k https://${DR_PROV_IP}:8443/internal/prov
+${PMMAPPER_BASE_URL}                     http://${PMMAPPER_IP}:8081
+${DELIVERY_ENDPOINT}                     /delivery
 
 *** Test Cases ***
 
@@ -28,6 +33,24 @@ Verify 3GPP PM Mapper Subscribes to Data Router
     Should Be Equal As Strings      ${cli_cmd_output.rc}            0
     Should Contain                  ${cli_cmd_output.stdout}        3gpppmmapper
 
+Verify 3GPP PM Mapper responds appropriately when no metadata is provided
+    [Tags]                          PM_MAPPER_10
+    [Documentation]                 Verify 3GPP PM Mapper responds 400 with the message "Missing Metadata." when no metadata is provided
+    [Timeout]                       1 minute
+    ${headers}=                     Create Dictionary               X-ONAP-RequestID=1  Content-Type=application/xml
+    ${resp}=                        Put Request                     mapper_session  ${DELIVERY_ENDPOINT}    data='${EMPTY}'    headers=${headers}
+    Should Be Equal As Strings      ${resp.status_code}             400
+    Should Be Equal As Strings      ${resp.content}                 Missing Metadata.
+
+Verify 3GPP PM Mapper responds appropriately when invalid metadata is provided
+    [Tags]                          PM_MAPPER_11
+    [Documentation]                 Verify 3GPP PM Mapper responds 400 with the message "Malformed Metadata." when invalid metadata is provided
+    [Timeout]                       1 minute
+    ${headers}=                     Create Dictionary               X-ONAP-RequestID=1  X-ATT-DR-META='not metadata'  Content-Type=application/xml
+    ${resp}=                        Put Request                     mapper_session  ${DELIVERY_ENDPOINT}  data='${EMPTY}'  headers=${headers}
+    Should Be Equal As Strings      ${resp.status_code}             400
+    Should Be Equal As Strings      ${resp.content}                 Malformed Metadata.
+
 *** Keywords ***
 
 PostCall