aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/dcaegen2-pmmapper/pmmapper/__init__.robot2
-rw-r--r--tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot23
2 files changed, 24 insertions, 1 deletions
diff --git a/tests/dcaegen2-pmmapper/pmmapper/__init__.robot b/tests/dcaegen2-pmmapper/pmmapper/__init__.robot
index 7114fd44..3e4501c2 100644
--- a/tests/dcaegen2-pmmapper/pmmapper/__init__.robot
+++ b/tests/dcaegen2-pmmapper/pmmapper/__init__.robot
@@ -1,2 +1,2 @@
*** Settings ***
-Documentation 5G Bulk PM E2E Testcases
+Documentation PM Mapper Testcases
diff --git a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot
index 1e3d9e91..a05defb5 100644
--- a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot
+++ b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot
@@ -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