Adding PM Mapper Test to BulkPMe2e tests
-Check PM Mapper contains XML file
-Check MR contains PMMeas VES
Change-Id: I8f86aa75ace47ce4c00136169832136c3fac8a92
Issue-ID: INT-832
Signed-off-by: LiamBurke <liam.burke@ericsson.com>
diff --git a/plans/usecases/5G-bulkpm/composefile/docker-compose-e2e.yml b/plans/usecases/5G-bulkpm/composefile/docker-compose-e2e.yml
index 86c5fe3..7880656 100644
--- a/plans/usecases/5G-bulkpm/composefile/docker-compose-e2e.yml
+++ b/plans/usecases/5G-bulkpm/composefile/docker-compose-e2e.yml
@@ -22,6 +22,7 @@
retries: 5
extra_hosts:
- "dmaap-dr-node:1.1.1.1"
+ - "dcae-pm-mapper:3.3.3.3"
datarouter-node:
image: nexus3.onap.org:10001/onap/dmaap/datarouter-node:2.1.0-SNAPSHOT-latest
@@ -37,6 +38,7 @@
condition: service_healthy
extra_hosts:
- "dmaap-dr-prov:2.2.2.2"
+ - "dcae-pm-mapper:3.3.3.3"
datarouter-subscriber:
image: nexus3.onap.org:10001/onap/dmaap/datarouter-subscriber:2.1.0-SNAPSHOT-latest
diff --git a/plans/usecases/5G-bulkpm/setup.sh b/plans/usecases/5G-bulkpm/setup.sh
index 265ec96..1bba4f3 100644
--- a/plans/usecases/5G-bulkpm/setup.sh
+++ b/plans/usecases/5G-bulkpm/setup.sh
@@ -70,8 +70,6 @@
mkdir docker-compose
cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose
cp $WORKSPACE/plans/usecases/5G-bulkpm/composefile/docker-compose-e2e.yml $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/docker-compose.yml
-cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/docker-databus-controller.conf /tmp/
-sed -i 's/DMAAPMR/'$DMAAP_MR_IP'/g' /tmp/docker-databus-controller.conf
docker login -u docker -p docker nexus3.onap.org:10001
docker-compose up -d
@@ -179,6 +177,7 @@
sed -i 's/sftpserver/'${SFTP_IP}'/g' $WORKSPACE/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotificationUpdated.json
sed -i 's/sftpport/'${SFTP_PORT}'/g' $WORKSPACE/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotificationUpdated.json
docker cp $WORKSPACE/plans/usecases/5G-bulkpm/assets/xNF.pm.xml.gz sftp:/home/admin/
+docker cp $WORKSPACE/tests/dcaegen2-pmmapper/pmmapper/assets/A20181002.0000-1000-0015-1000_5G.xml.gz sftp:/home/admin/
# Data Router Configuration:
# Create default feed and create file consumer subscriber on data router
@@ -205,15 +204,25 @@
sed -i 's/4.4.4.4/'$DMAAP_MR_IP'/g' docker-compose.yml
docker-compose up -d
+cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose
+PMMAPPER_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pmmapper)
+docker kill datarouter-node
+docker kill datarouter-prov
+sed -i 's/1.1.1.1/'$DR_NODE_IP'/g' docker-compose.yml
+sed -i 's/2.2.2.2/'$DR_PROV_IP'/g' docker-compose.yml
+sed -i 's/3.3.3.3/'$PMMAPPER_IP'/g' docker-compose.yml
+docker-compose up -d
+
# Setting up PM Mapper certs.
docker cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/cert.jks.b64 pmmapper:opt/app/pm-mapper/etc/
docker cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/jks.pass pmmapper:opt/app/pm-mapper/etc/
docker cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/trust.jks.b64 pmmapper:opt/app/pm-mapper/etc/
docker cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/trust.pass pmmapper:opt/app/pm-mapper/etc/
docker restart pmmapper
+sleep 5
# Create PM Mapper feed and create PM Mapper subscriber on data router
-curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" --data-ascii @$WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/createFeed.json --post301 --location-trusted -k https://${DR_PROV_IP}:8443
+#curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" --data-ascii @$WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/createFeed.json --post301 --location-trusted -k https://${DR_PROV_IP}:8443
curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" --data-ascii @$WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/addSubscriber.json --post301 --location-trusted -k https://${DR_PROV_IP}:8443/subscribe/1
# Create PM Mapper tocic in Message Router
diff --git a/plans/usecases/5G-bulkpm/teardown.sh b/plans/usecases/5G-bulkpm/teardown.sh
index 5b3d171..d52b773 100644
--- a/plans/usecases/5G-bulkpm/teardown.sh
+++ b/plans/usecases/5G-bulkpm/teardown.sh
@@ -1,9 +1,15 @@
#!/bin/bash
echo "Starting teardown script"
docker exec dfc /bin/sh -c "less /var/log/ONAP/application.log" > /tmp/dfc_docker.log
+echo "===== DFC LOG ========"
cat /tmp/dfc_docker.log
sleep 3
-rm /tmp/dfc_docker.log.robot
+echo "===== PM MAPPER LOG ========"
+#cat /tmp/pmmapper_docker.log.robot
+sleep 2
+echo "===== MR LOG ========"
+#cat /tmp/mr.log
+sleep 2
kill-instance.sh $DMAAP
kill-instance.sh $KAFKA
kill-instance.sh $ZOOKEEPER
diff --git a/tests/dcaegen2-pmmapper/pmmapper/assets/.gitattributes b/tests/dcaegen2-pmmapper/pmmapper/assets/.gitattributes
new file mode 100644
index 0000000..57cdc50
--- /dev/null
+++ b/tests/dcaegen2-pmmapper/pmmapper/assets/.gitattributes
@@ -0,0 +1 @@
+*.gz binary
diff --git a/tests/dcaegen2-pmmapper/pmmapper/assets/A20181002.0000-1000-0015-1000_5G.xml.gz b/tests/dcaegen2-pmmapper/pmmapper/assets/A20181002.0000-1000-0015-1000_5G.xml.gz
new file mode 100644
index 0000000..32865fc
--- /dev/null
+++ b/tests/dcaegen2-pmmapper/pmmapper/assets/A20181002.0000-1000-0015-1000_5G.xml.gz
Binary files differ
diff --git a/tests/usecases/5G-bulkpm/BulkpmE2E.robot b/tests/usecases/5G-bulkpm/BulkpmE2E.robot
index dcf9721..84243cb 100644
--- a/tests/usecases/5G-bulkpm/BulkpmE2E.robot
+++ b/tests/usecases/5G-bulkpm/BulkpmE2E.robot
@@ -20,8 +20,12 @@
${CLI_EXEC_CLI_FILECONSUMER} docker exec fileconsumer-node /bin/sh -c "ls /opt/app/subscriber/delivery | grep .xml"
${CLI_EXEC_CLI_DFC_LOG} docker exec dfc /bin/sh -c "cat /var/log/ONAP/application.log" > /tmp/dfc_docker.log.robot
${CLI_EXEC_CLI_DFC_LOG_GREP} grep "Publish to DR successful!" /tmp/dfc_docker.log.robot
-${CLI_EXEC_CLI_FILECONSUMER_CP} docker cp fileconsumer-node:/opt/app/subscriber/delivery/xNF.pm.xml.M %{WORKSPACE}
-${CLI_EXEC_RENAME_METADATA} mv %{WORKSPACE}/xNF.pm.xml.M %{WORKSPACE}/metadata.json
+${CLI_EXEC_CLI_FILECONSUMER_CP} docker cp fileconsumer-node:/opt/app/subscriber/delivery/A20181002.0000-1000-0015-1000_5G.xml.M %{WORKSPACE}
+${CLI_EXEC_RENAME_METADATA} mv %{WORKSPACE}/A20181002.0000-1000-0015-1000_5G.xml.M %{WORKSPACE}/metadata.json
+${CLI_EXEC_CLI_PMMAPPER_LOG} docker exec pmmapper /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" > /tmp/pmmapper_docker.log.robot
+${CLI_EXEC_CLI_PMMAPPER_LOG_GREP} grep "XML validation successful Event" /tmp/pmmapper_docker.log.robot
+${CLI_EXEC_MR_PMMAPPER_TOPIC} curl http://${DMAAP_MR_IP}:3904/events/PM_MAPPER/CG1/C1?timeout=1000 > /tmp/mr.log
+${CLI_EXEC_CLI_PMMAPPER_TOPIC_LOG_GREP} grep "perf3gpp_RnNode-Ericsson_pmMeasResult" /tmp/mr.log
${metadataSchemaPath} %{WORKSPACE}/tests/usecases/5G-bulkpm/assets/metadata.schema.json
${metadataJsonPath} %{WORKSPACE}/metadata.json
@@ -86,7 +90,7 @@
${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_FILECONSUMER} shell=yes
Log ${cli_cmd_output.stdout}
Should Be Equal As Strings ${cli_cmd_output.rc} 0
- Should Contain ${cli_cmd_output.stdout} xNF.pm.xml
+ Should Contain ${cli_cmd_output.stdout} A20181002.0000-1000-0015-1000_5G.xml
Verify File Consumer Receive valid metadata from Data Router
[Tags] Bulk_PM_E2E_06
@@ -94,8 +98,30 @@
${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_FILECONSUMER} shell=yes
Log ${cli_cmd_output.stdout}
Should Be Equal As Strings ${cli_cmd_output.rc} 0
- Should Contain ${cli_cmd_output.stdout} xNF.pm.xml.M
+ Should Contain ${cli_cmd_output.stdout} A20181002.0000-1000-0015-1000_5G.xml.M
${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_FILECONSUMER_CP} shell=yes
${cli_cmd_output}= Run Process ${CLI_EXEC_RENAME_METADATA} shell=yes
${validation_result}= Validate ${metadataSchemaPath} ${metadataJsonPath}
- Should Be Equal As Strings ${validation_result} 0
\ No newline at end of file
+ Should Be Equal As Strings ${validation_result} 0
+
+Verify PM-Mapper successfully receives uncompressed the PM XML file
+ [Tags] Bulk_PM_E2E_07
+ [Documentation] Check that PM-Mapper receives the uncompressed PM XML file
+ ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_LOG} shell=yes
+ Log ${cli_cmd_output.stdout}
+ Should Be Equal As Strings ${cli_cmd_output.rc} 0
+ ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_LOG_GREP} 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 Event
+
+Verify PM-Mapper successfully publishes PMMeasResult VES onto the Message Router Topic PM_MAPPER
+ [Tags] Bulk_PM_E2E_08
+ [Documentation] Check that PM-Mapper publishes VES onto the Message Router
+ ${cli_cmd_output}= Run Process ${CLI_EXEC_MR_PMMAPPER_TOPIC} shell=yes
+ Log ${cli_cmd_output.stdout}
+ Should Be Equal As Strings ${cli_cmd_output.rc} 0
+ ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_TOPIC_LOG_GREP} shell=yes
+ Log ${cli_cmd_output.stdout}
+ Should Be Equal As Strings ${cli_cmd_output.rc} 0
+ Should Contain ${cli_cmd_output.stdout} perf3gpp_RnNode-Ericsson_pmMeasResult
\ No newline at end of file
diff --git a/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotification.json b/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotification.json
index d5d8fd0..375dbd8 100644
--- a/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotification.json
+++ b/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotification.json
@@ -19,9 +19,9 @@
"changeType": "FileReady",
"notificationFieldsVersion": "2.0",
"arrayOfNamedHashMap": [
- { "name": "xNF.pm.xml.gz",
+ { "name": "A20181002.0000-1000-0015-1000_5G.xml.gz",
"hashMap":{
- "location": "sftp://admin:admin@sftpserver:sftpport/xNF.pm.xml.gz",
+ "location": "sftp://admin:admin@sftpserver:sftpport/A20181002.0000-1000-0015-1000_5G.xml.gz",
"compression": "gzip",
"fileFormatType": "org.3GPP.32.435#measCollec",
"fileFormatVersion": "V10"