aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plans/dcaegen2-pmmapper/pmmapper/assets/config.json10
-rw-r--r--plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-e2e.yml8
-rw-r--r--plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-pmmapper.yml5
-rw-r--r--plans/dcaegen2-pmmapper/pmmapper/setup.sh2
-rw-r--r--tests/dcaegen2-collectors-hv-ves/testcases/message-routing.robot4
-rw-r--r--tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/too-big-payload/dcae-too-big-payload-request.json24
-rw-r--r--tests/dcaegen2-pmmapper/pmmapper/assets/meas_result.xml24
-rw-r--r--tests/dcaegen2-pmmapper/pmmapper/assets/no_managed_element.xml27
-rw-r--r--tests/dcaegen2-pmmapper/pmmapper/assets/no_measdata.xml11
-rw-r--r--tests/dcaegen2-pmmapper/pmmapper/assets/valid_metadata.json12
-rw-r--r--tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot69
11 files changed, 180 insertions, 16 deletions
diff --git a/plans/dcaegen2-pmmapper/pmmapper/assets/config.json b/plans/dcaegen2-pmmapper/pmmapper/assets/config.json
index 47b215f5..56629e09 100644
--- a/plans/dcaegen2-pmmapper/pmmapper/assets/config.json
+++ b/plans/dcaegen2-pmmapper/pmmapper/assets/config.json
@@ -1,6 +1,5 @@
{
"pm-mapper-filter": "{ \"filters\":[]}",
- "3GPP.schema.file": "{\"3GPP_Schema\":\"./etc/3GPP_relaxed_schema.xsd\"}",
"streams_subscribes": {
"dmaap_subscriber": {
"type": "data_router",
@@ -8,15 +7,15 @@
"aaf_password": null,
"dmaap_info": {
"location": "csit-pmmapper",
- "delivery_url": "3gpppmmapper",
+ "delivery_url": "http://3gpppmmapper:8081/delivery",
"username": "username",
"password": "password",
- "subscriber_id": "subsriber_id"
+ "subscriber_id": "subscriber_id"
}
}
},
"streams_publishes": {
- "pm_mapper_handle_out": {
+ "dmaap_publisher": {
"type": "message_router",
"aaf_password": null,
"dmaap_info": {
@@ -28,7 +27,8 @@
"aaf_username": null
}
},
- "buscontroller_feed_id": "1",
+ "dmaap_dr_feed_id": "1",
"buscontroller_feed_subscription_endpoint": "http://dmaap-bc:8080/webapi/dr_subs",
+ "dmaap_dr_delete_endpoint": "http://dmaap-dr-node:8443/delete",
"services_calls": {}
} \ No newline at end of file
diff --git a/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-e2e.yml b/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-e2e.yml
index ff1b517a..9c8805b7 100644
--- a/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-e2e.yml
+++ b/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-e2e.yml
@@ -1,7 +1,7 @@
version: '2.1'
services:
datarouter-prov:
- image: nexus3.onap.org:10001/onap/dmaap/datarouter-prov:2.0.0-SNAPSHOT
+ image: nexus3.onap.org:10001/onap/dmaap/datarouter-prov:2.0.1
container_name: datarouter-prov
hostname: dmaap-dr-prov
ports:
@@ -22,7 +22,7 @@ services:
retries: 5
datarouter-node:
- image: nexus3.onap.org:10001/onap/dmaap/datarouter-node:2.0.0-SNAPSHOT
+ image: nexus3.onap.org:10001/onap/dmaap/datarouter-node:2.0.1
container_name: datarouter-node
hostname: dmaap-dr-node
ports:
@@ -67,8 +67,8 @@ services:
- "18080:8080"
- "18443:8443"
extra_hosts:
- - "dmaap-dr-prov: DMAAPDR"
- - "message-router: DMAAPMR"
+ - "dmaap-dr-prov:DMAAPDR"
+ - "message-router:DMAAPMR"
volumes:
- /tmp/docker-databus-controller.conf:/opt/app/config/conf
depends_on:
diff --git a/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-pmmapper.yml b/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-pmmapper.yml
index 0833dfe8..b14a73c6 100644
--- a/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-pmmapper.yml
+++ b/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-pmmapper.yml
@@ -2,7 +2,7 @@ version: '2.1'
services:
pmmapper:
container_name: pmmapper
- image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pm-mapper:1.0-SNAPSHOT
+ image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pm-mapper
ports:
- "8081:8081"
environment:
@@ -10,4 +10,5 @@ services:
CONFIG_BINDING_SERVICE_SERVICE_PORT: 10000
HOSTNAME: pmmapper
extra_hosts:
- - "dmaap-bc: BUSIP" \ No newline at end of file
+ - "dmaap-bc:BUSIP"
+ - "dmaap-dr-node:DRNODEIP"
diff --git a/plans/dcaegen2-pmmapper/pmmapper/setup.sh b/plans/dcaegen2-pmmapper/pmmapper/setup.sh
index 9de81667..806728d5 100644
--- a/plans/dcaegen2-pmmapper/pmmapper/setup.sh
+++ b/plans/dcaegen2-pmmapper/pmmapper/setup.sh
@@ -121,6 +121,7 @@ cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-pmmapp
CBS_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' cbs)
sed -i 's/CBSIP/'$CBS_IP'/g' docker-compose.yml
sed -i 's/BUSIP/'$DMAAPBC_IP'/g' docker-compose.yml
+sed -i 's/DRNODEIP/'$DR_NODE_IP'/g' docker-compose.yml
docker-compose up -d
# Wait for initialization of Docker container for 3GPP PM Mapper
@@ -136,6 +137,7 @@ for i in {1..10}; do
done
PMMAPPER_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pmmapper)
docker exec datarouter-prov /bin/sh -c "echo '${PMMAPPER_IP}' 3gpppmmapper >> /etc/hosts"
+docker exec datarouter-node /bin/sh -c "echo '${PMMAPPER_IP}' 3gpppmmapper >> /etc/hosts"
sleep 10
docker exec pmmapper /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" > /tmp/pmmapper.log
cat /tmp/pmmapper.log
diff --git a/tests/dcaegen2-collectors-hv-ves/testcases/message-routing.robot b/tests/dcaegen2-collectors-hv-ves/testcases/message-routing.robot
index 1850df61..c22c936f 100644
--- a/tests/dcaegen2-collectors-hv-ves/testcases/message-routing.robot
+++ b/tests/dcaegen2-collectors-hv-ves/testcases/message-routing.robot
@@ -37,7 +37,8 @@ Too big payload message handling
Send Messages From xNF Simulators ${XNF_SIMULATOR} ${XNF_TOO_BIG_PAYLOAD_REQUEST}
Wait until keyword succeeds 60 sec 5 sec
- ... Assert Dcae App Consumed Less Equal Than ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_25000}
+ ... Assert Dcae App Consumed ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_25000}
+ Assert Dcae App Consumed Proper Messages ${DCAE_APP_API_MESSAGES_VALIDATION_URL} ${DCAE_TOO_BIG_PAYLOAD_REQUEST}
Invalid wire frame message handling
@@ -85,6 +86,7 @@ ${XNF_INVALID_GPB_DATA_REQUEST} ${VES_HV_SCENARIOS}/invalid-gpb-d
${XNF_UNSUPPORTED_DOMAIN_REQUEST} ${VES_HV_SCENARIOS}/unsupported-domain/xnf-unsupported-domain-request.json
${DCAE_FIXED_PAYLOAD_REQUEST} ${VES_HV_SCENARIOS}/fixed-payload/dcae-fixed-payload-request.json
+${DCAE_TOO_BIG_PAYLOAD_REQUEST} ${VES_HV_SCENARIOS}/too-big-payload/dcae-too-big-payload-request.json
${DCAE_INVALID_WIRE_FRAME_REQUEST} ${VES_HV_SCENARIOS}/invalid-wire-frame/dcae-invalid-wire-frame-request.json
${DCAE_INVALID_GPB_DATA_REQUEST} ${VES_HV_SCENARIOS}/invalid-gpb-data/dcae-invalid-gpb-data-request.json
${DCAE_UNSUPPORTED_DOMAIN_REQUEST} ${VES_HV_SCENARIOS}/unsupported-domain/dcae-unsupported-domain-request.json
diff --git a/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/too-big-payload/dcae-too-big-payload-request.json b/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/too-big-payload/dcae-too-big-payload-request.json
new file mode 100644
index 00000000..1820d08f
--- /dev/null
+++ b/tests/dcaegen2-collectors-hv-ves/testcases/resources/scenarios/too-big-payload/dcae-too-big-payload-request.json
@@ -0,0 +1,24 @@
+[
+ {
+ "commonEventHeader": {
+ "version": "sample-version",
+ "domain": "perf3gpp",
+ "sequence": 1,
+ "priority": 1,
+ "eventId": "sample-event-id",
+ "eventName": "sample-event-name",
+ "eventType": "sample-event-type",
+ "startEpochMicrosec": 120034455,
+ "lastEpochMicrosec": 120034455,
+ "nfNamingCode": "sample-nf-naming-code",
+ "nfcNamingCode": "sample-nfc-naming-code",
+ "reportingEntityId": "sample-reporting-entity-id",
+ "reportingEntityName": "sample-reporting-entity-name",
+ "sourceId": "sample-source-id",
+ "sourceName": "sample-source-name",
+ "vesEventListenerVersion": "7.2.0"
+ },
+ "messageType": "VALID",
+ "messagesAmount": 25000
+ }
+]
diff --git a/tests/dcaegen2-pmmapper/pmmapper/assets/meas_result.xml b/tests/dcaegen2-pmmapper/pmmapper/assets/meas_result.xml
new file mode 100644
index 00000000..269fdf1d
--- /dev/null
+++ b/tests/dcaegen2-pmmapper/pmmapper/assets/meas_result.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<measCollecFile xmlns="http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec">
+ <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd"
+ fileFormatVersion="32.435 V10.0">
+ <fileSender localDn="Dublin"/>
+ <measCollec beginTime="2018-10-02T12:00:00+01:00"/>
+ </fileHeader>
+ <measData>
+ <managedElement swVersion="r0.1" localDn="Dublin"/>
+ <measInfo measInfoId="some measInfoId">
+ <job jobId="jobId"/>
+ <granPeriod endTime="2018-10-02T12:15:00Z" duration="PT900S"/>
+ <repPeriod duration="PT900S"/>
+ <measTypes>a b c</measTypes>
+ <measValue measObjLdn="objLdn">
+ <measResults>76 27 98</measResults>
+ <suspect>false</suspect>
+ </measValue>
+ </measInfo>
+ </measData>
+ <fileFooter>
+ <measCollec endTime="2018-10-02T12:15:00+01:00"/>
+ </fileFooter>
+</measCollecFile>
diff --git a/tests/dcaegen2-pmmapper/pmmapper/assets/no_managed_element.xml b/tests/dcaegen2-pmmapper/pmmapper/assets/no_managed_element.xml
new file mode 100644
index 00000000..23e5c215
--- /dev/null
+++ b/tests/dcaegen2-pmmapper/pmmapper/assets/no_managed_element.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<measCollecFile xmlns="http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec">
+ <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd"
+ fileFormatVersion="32.435 V10.0">
+ <fileSender localDn="Dublin"/>
+ <measCollec beginTime="2018-10-02T12:00:00+01:00"/>
+ </fileHeader>
+ <measData>
+ <measInfo measInfoId="some measInfoId">
+ <job jobId="some job Id"/>
+ <granPeriod endTime="2018-10-02T12:15:00Z" duration="some duration"/>
+ <repPeriod duration="PT900S"/>
+ <measType p="1">a</measType>
+ <measType p="2">b</measType>
+ <measType p="3">c</measType>
+ <measValue measObjLdn="some measObjLdn">
+ <r p="1">86</r>
+ <r p="2">67</r>
+ <r p="3">14</r>
+ <suspect>false</suspect>
+ </measValue>
+ </measInfo>
+ </measData>
+ <fileFooter>
+ <measCollec endTime="2018-10-02T12:15:00+01:00"/>
+ </fileFooter>
+</measCollecFile> \ No newline at end of file
diff --git a/tests/dcaegen2-pmmapper/pmmapper/assets/no_measdata.xml b/tests/dcaegen2-pmmapper/pmmapper/assets/no_measdata.xml
new file mode 100644
index 00000000..855b2e91
--- /dev/null
+++ b/tests/dcaegen2-pmmapper/pmmapper/assets/no_measdata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<measCollecFile xmlns="http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec">
+ <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd"
+ fileFormatVersion="32.435 V10.0">
+ <fileSender localDn="Dublin"/>
+ <measCollec beginTime="2018-10-02T12:00:00+01:00"/>
+ </fileHeader>
+ <fileFooter>
+ <measCollec endTime="2018-10-02T12:15:00+01:00"/>
+ </fileFooter>
+</measCollecFile>
diff --git a/tests/dcaegen2-pmmapper/pmmapper/assets/valid_metadata.json b/tests/dcaegen2-pmmapper/pmmapper/assets/valid_metadata.json
new file mode 100644
index 00000000..3a2340f2
--- /dev/null
+++ b/tests/dcaegen2-pmmapper/pmmapper/assets/valid_metadata.json
@@ -0,0 +1,12 @@
+{
+ "productName": "NrRadio",
+ "vendorName": "Ericsson",
+ "lastEpochMicrosec": "1538478000000",
+ "sourceName": "oteNB5309",
+ "startEpochMicrosec": "1538478900000",
+ "timeZoneOffset": "UTC+05.00",
+ "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz",
+ "compression": "gzip",
+ "fileFormatType": "org.3GPP.32.435#measCollec",
+ "fileFormatVersion": "V9"
+ } \ No newline at end of file
diff --git a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot
index a05defb5..363c95c1 100644
--- a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot
+++ b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot
@@ -14,6 +14,12 @@ ${CLI_EXEC_CLI_CONFIG} { head -n 5 | tail -1;} < /tmp/pmmapper
${CLI_EXEC_CLI_SUBS} curl -k https://${DR_PROV_IP}:8443/internal/prov
${PMMAPPER_BASE_URL} http://${PMMAPPER_IP}:8081
${DELIVERY_ENDPOINT} /delivery
+${HEALTHCHECK_ENDPOINT} /healthcheck
+${NO_MANAGED_ELEMENT_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/no_managed_element.xml
+${NO_MEASDATA_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/no_measdata.xml
+${MEASD_RESULT_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/meas_result.xml
+${VALID_METADATA_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/valid_metadata.json
+${CLI_EXEC_CLI_PM_LOG} docker exec pmmapper /bin/sh -c "tail -5 /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log"
*** Test Cases ***
@@ -33,12 +39,20 @@ 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 Health Check returns 200 when a REST GET request to healthcheck url
+ [Tags] PM_MAPPER_03
+ [Documentation] Verify Health Check returns 200 when a REST GET request to healthcheck url
+ [Timeout] 1 minute
+ ${resp}= Get Request mapper_session ${HEALTHCHECK_ENDPOINT}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+
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}
+ ${resp}= Put Request mapper_session ${DELIVERY_ENDPOINT}/filename data='${EMPTY}' headers=${headers}
Should Be Equal As Strings ${resp.status_code} 400
Should Be Equal As Strings ${resp.content} Missing Metadata.
@@ -46,15 +60,62 @@ 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}
+ ${headers}= Create Dictionary X-ONAP-RequestID=1 X-DMAAP-DR-META='not metadata' Content-Type=application/xml
+ ${resp}= Put Request mapper_session ${DELIVERY_ENDPOINT}/filename data='${EMPTY}' headers=${headers}
Should Be Equal As Strings ${resp.status_code} 400
Should Be Equal As Strings ${resp.content} Malformed Metadata.
+
+Verify that PM Mapper throws Event failed validation against schema error when no managed element content is provided
+ [Tags] PM_MAPPER_12
+ [Documentation] Verify 3gpp pm mapper responds with an error when no managed element content is provided
+ [Timeout] 1 minute
+ ${no_managed_element_content}= Get File ${NO_MANAGED_ELEMENT_PATH}
+ ${valid_metatdata} Get File ${VALID_METADATA_PATH}
+ ${headers}= Create Dictionary X-ONAP-RequestID=2 Content-Type=application/xml X-DMAAP-DR-PUBLISH-ID=2 X-DMAAP-DR-META=${valid_metatdata.replace("\n","")}
+ ${resp}= Put Request mapper_session ${DELIVERY_ENDPOINT}/filename data=${no_managed_element_content} headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 200
+ ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PM_LOG} shell=yes
+ Log ${cli_cmd_output.stdout}
+ Should Be Equal As Strings ${cli_cmd_output.rc} 0
+ Should Contain ${cli_cmd_output.stdout} XML validation failed
+
+
+Verify that PM Mapper logs successful when a file that contains no measdata is provided
+ [Tags] PM_MAPPER_13
+ [Documentation] Verify that PM Mapper logs successful when a file that contains no measdata is provided
+ [Timeout] 1 minute
+ ${valid_no_measdata_content}= Get File ${NO_MEASDATA_PATH}
+ ${valid_metatdata} Get File ${VALID_METADATA_PATH}
+ ${headers}= Create Dictionary X-ONAP-RequestID=3 Content-Type=application/xml X-DMAAP-DR-PUBLISH-ID=3 X-DMAAP-DR-META=${valid_metatdata.replace("\n","")}
+ ${resp}= Put Request mapper_session ${DELIVERY_ENDPOINT}/filename data=${valid_no_measdata_content} headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 200
+ ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PM_LOG} shell=yes
+ Log ${cli_cmd_output.stdout}
+ Should Be Equal As Strings ${cli_cmd_output.rc} 0
+ Should Contain ${cli_cmd_output.stdout} XML validation successful
+
+
+Verify that PM Mapper logs successful when a file that contains measdata is provided
+ [Tags] PM_MAPPER_14
+ [Documentation] Verify that PM Mapper logs successful when a file that contains measdata is provided
+ [Timeout] 1 minute
+ ${valid_meas_result_content}= Get File ${MEASD_RESULT_PATH}
+ ${valid_metatdata} Get File ${VALID_METADATA_PATH}
+ ${headers}= Create Dictionary X-ONAP-RequestID=4 Content-Type=application/xml X-DMAAP-DR-PUBLISH-ID=4 X-DMAAP-DR-META=${valid_metatdata.replace("\n","")}
+ ${resp}= Put Request mapper_session ${DELIVERY_ENDPOINT}/filename data=${valid_meas_result_content} headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 200
+ ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PM_LOG} shell=yes
+ Log ${cli_cmd_output.stdout}
+ Should Be Equal As Strings ${cli_cmd_output.rc} 0
+ Should Contain ${cli_cmd_output.stdout} XML validation successful
+
+
+
*** Keywords ***
PostCall
[Arguments] ${url} ${data}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests
- [Return] ${resp} \ No newline at end of file
+ [Return] ${resp}