diff options
author | Gary Wu <gary.i.wu@huawei.com> | 2019-03-27 16:06:15 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-27 16:06:15 +0000 |
commit | a525142e100f3bf3dd6f151aeab3ae1e2614e124 (patch) | |
tree | a6be9376172a4a07dae76a12b1bf00a2e62bd614 | |
parent | 161a243a1bc0ab0b8bba9b337f7f36f06d6c2dae (diff) | |
parent | 59a78505388a584234c1916a0062b3230f0192aa (diff) |
Merge "Setup files to support PM Mapper Publishing"
6 files changed, 58 insertions, 66 deletions
diff --git a/plans/dcaegen2-pmmapper/pmmapper/assets/config.json b/plans/dcaegen2-pmmapper/pmmapper/assets/config.json index 5eec4380..79b32012 100644 --- a/plans/dcaegen2-pmmapper/pmmapper/assets/config.json +++ b/plans/dcaegen2-pmmapper/pmmapper/assets/config.json @@ -19,8 +19,8 @@ "type": "message_router", "aaf_password": null, "dmaap_info": { - "topic_url": "https://message-router:3904/events/org.onap.dmaap.onapCSIT.pm_mapper", - "client_role": "org.onap.dmaap.client.pub", + "topic_url": "http://message-router:3904/events/topic.org.onap.dmaap.mr.test1", + "client_role": "org.onap.dmaap.mr.topic", "location": "csit-pmmapper", "client_id": null }, diff --git a/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-pmmapper.yml b/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-pmmapper.yml index b14a73c6..a7f5b973 100644 --- a/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-pmmapper.yml +++ b/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-pmmapper.yml @@ -12,3 +12,4 @@ services: extra_hosts: - "dmaap-bc:BUSIP" - "dmaap-dr-node:DRNODEIP" + - "message-router:DMAAPMRIP" diff --git a/plans/dcaegen2-pmmapper/pmmapper/dmaapbc.sh b/plans/dcaegen2-pmmapper/pmmapper/dmaapbc.sh index 14051121..14302589 100755 --- a/plans/dcaegen2-pmmapper/pmmapper/dmaapbc.sh +++ b/plans/dcaegen2-pmmapper/pmmapper/dmaapbc.sh @@ -1,22 +1,23 @@ #!/bin/bash # $1 is the IP address of the buscontroller + # INITIALIZE: dmaap object +echo $'\nInitializing /dmaap endpoint' JSON=/tmp/dmaap.json cat << EOF > $JSON { "version": "1", -"topicNsRoot": "org.onap.dmaap", +"topicNsRoot": "topic.org.onap.dmaap", "drProvUrl": "https://dmaap-dr-prov:8443", -"dmaapName": "DataRouter", +"dmaapName": "mr", "bridgeAdminTopic": "MM_AGENT_PROV" } EOF - -echo "Initializing /dmaap endpoint" curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/dmaap # INITIALIZE: dcaeLocation object +echo $'\nInitializing /dcaeLocations endpoint' JSON=/tmp/dcaeLocation.json cat << EOF > $JSON { @@ -26,26 +27,25 @@ cat << EOF > $JSON "zone": "zoneA" } EOF - -echo "Initializing /dcaeLocations endpoint" curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/dcaeLocations # INITIALIZE: MR object in 1 site +echo $'\nInitializing /mr_clusters endpoint' +DMAAP=$(docker ps -a -q --filter="name=dmaap_1") DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DMAAP) JSON=/tmp/mr.json cat << EOF > $JSON { "dcaeLocationName": "csit-pmmapper", -"fqdn": "$DMAAP_MR_IP", +"fqdn": "${DMAAP_MR_IP}", "topicProtocol" : "http", "topicPort": "3904" } EOF - -echo "Initializing /mr_clusters endpoint" curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/mr_clusters # CREATING: DR feed +echo $'\nInitializing /feeds endpoint' JSON=/tmp/feed.json cat << EOF > $JSON { @@ -67,6 +67,30 @@ cat << EOF > $JSON ] } EOF -echo "Initializing /feeds endpoint" curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/feeds + +# CREATING: MR Topic +echo $'\nInitializing /topic endpoint' +JSON=/tmp/topic.json +cat << EOF > $JSON +{ +"topicName":"test1", +"topicDescription":"PM Mapper - VES Event", +"owner":"pmmapper" +} +EOF +curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/topics + +# CREATING: MR Client +echo $'\nInitializing /mr_clients endpoint' +JSON=/tmp/mrclients.json +cat << EOF > $JSON +{ +"fqtn": "topic.org.onap.dmaap.mr.test1", +"dcaeLocationName": "csit-pmmapper", +"clientRole": "org.onap.dmaap.mr.topic", +"action": [ "pub", "view" ] +} +EOF +curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/mr_clients sleep 5
\ No newline at end of file diff --git a/plans/dcaegen2-pmmapper/pmmapper/setup.sh b/plans/dcaegen2-pmmapper/pmmapper/setup.sh index 2924bd21..18d82373 100644 --- a/plans/dcaegen2-pmmapper/pmmapper/setup.sh +++ b/plans/dcaegen2-pmmapper/pmmapper/setup.sh @@ -122,6 +122,7 @@ CBS_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddres 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 +sed -i 's/DMAAPMRIP/'$DMAAP_MR_IP'/g' docker-compose.yml docker-compose up -d # Wait for initialization of Docker container for 3GPP PM Mapper @@ -143,6 +144,7 @@ docker exec pmmapper /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pm-mapper/p cat /tmp/pmmapper.log docker exec buscontroller /bin/sh -c "cat /opt/app/dmaapbc/logs/ONAP/application.log" curl -k https://$DR_PROV_IP:8443/internal/prov +curl http://${DMAAP_MR_IP}:3904/events/topic.org.onap.dmaap.mr.test1/CG1/C1?timeout=1000 #Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v CONSUL_IP:${CONSUL_IP} -v DR_PROV_IP:${DR_PROV_IP} -v DMAAPBC_IP:${DMAAPBC_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v CBS_IP:${CBS_IP} -v PMMAPPER_IP:${PMMAPPER_IP} -v DR_NODE_IP:${DR_NODE_IP}"
\ No newline at end of file +ROBOT_VARIABLES="-v DMAAP_MR_IP:${DMAAP_MR_IP} -v CONSUL_IP:${CONSUL_IP} -v DR_PROV_IP:${DR_PROV_IP} -v DMAAPBC_IP:${DMAAPBC_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v CBS_IP:${CBS_IP} -v PMMAPPER_IP:${PMMAPPER_IP} -v DR_NODE_IP:${DR_NODE_IP}"
\ No newline at end of file diff --git a/tests/dcaegen2-pmmapper/pmmapper/assets/A_meas_result.xml b/tests/dcaegen2-pmmapper/pmmapper/assets/A_meas_result.xml deleted file mode 100644 index 269fdf1d..00000000 --- a/tests/dcaegen2-pmmapper/pmmapper/assets/A_meas_result.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?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/pmmapper.robot b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot index 311ee433..cbb77f93 100644 --- a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot +++ b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot @@ -17,7 +17,6 @@ ${DELIVERY_ENDPOINT} /delivery ${HEALTHCHECK_ENDPOINT} /healthcheck ${NO_MANAGED_ELEMENT_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/A_no_managed_element.xml ${NO_MEASDATA_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/A_no_measdata.xml -${MEASD_RESULT_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/A_meas_result.xml ${VALID_METADATA_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/valid_metadata.json ${DIFF_VENDOR_METADATA} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/diff_vendor_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" @@ -29,6 +28,7 @@ ${CLI_EXEC_PM_FILTER} curl 'http://${CONSUL_IP}:8500/v1/kv/pm ${CLI_RESTART_PMMAPPER} docker restart pmmapper ${CLI_DELETE_SUB1} curl -i -X DELETE -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:DGL" -k https://localhost:8443/subs/1 ${CLI_DELETE_SUB2} curl -i -X DELETE -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:DGL" -k https://localhost:8443/subs/2 +${CLI_MESSAGE_ROUTER_TOPIC} curl http://${DMAAP_MR_IP}:3904/events/topic.org.onap.dmaap.mr.test1/CG1/C1?timeout=2000 *** Test Cases *** @@ -43,7 +43,6 @@ Verify 3GPP PM Mapper Subscribes to Data Router CheckLog ${CLI_EXEC_CLI_SUBS} 3gpppmmapper CheckLog ${CLI_EXEC_CLI_SUBS} "privilegedSubscriber":true - 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 @@ -71,56 +70,46 @@ Verify 3GPP PM Mapper responds appropriately when invalid metadata is provided VerifyResponse ${resp.content} Malformed Metadata. CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=2 -Verify 3GPP PM Mapper received pushed PM data from Data Router +Verify 3GPP PM Mapper received pushed PM data from data router and publishes to message router. [Tags] PM_MAPPER_06 - [Documentation] Verify 3GPP PM Mapper received pushed PM data from Data Router + [Documentation] Verify 3GPP PM Mapper received pushed PM data from data router and publishes to message router. [Timeout] 1 minute ${PM_DATA}= Get File ${PM_DATA_FILE_PATH} ${valid_metatdata} Get File ${VALID_METADATA_PATH} ${resp}= PutCall ${PUBLISH_NODE_URL} 3 ${PM_DATA} ${PUBLISH_CONTENT_TYPE} ${valid_metatdata.replace("\n","")} pmmapper VerifyResponse ${resp.status_code} 204 Sleep 10s - CheckLog ${CLI_EXEC_CLI_PM_LOG} Event Processed + CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=3 - -Verify that PM Mapper logs successful when a file that contains measdata is provided - [Tags] PM_MAPPER_07 - [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}/A_meas_result.xml data=${valid_meas_result_content} headers=${headers} - VerifyResponse ${resp.status_code} 200 - CheckLog ${CLI_EXEC_CLI_PM_LOG} XML validation successful - CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=4 + Sleep 10s + CheckLog ${CLI_MESSAGE_ROUTER_TOPIC} perf3gpp_gnb-Ericsson_pmMeasResult Verify that PM Mapper logs successful when a file that contains no measdata is provided - [Tags] PM_MAPPER_08 + [Tags] PM_MAPPER_07 [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=5 Content-Type=application/xml X-DMAAP-DR-PUBLISH-ID=3 X-DMAAP-DR-META=${valid_metatdata.replace("\n","")} + ${headers}= Create Dictionary X-ONAP-RequestID=4 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}/A_no_measdata.xml data=${valid_no_measdata_content} headers=${headers} VerifyResponse ${resp.status_code} 200 - CheckLog ${CLI_EXEC_CLI_PM_LOG} XML validation successful - CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=5 + CheckLog ${CLI_EXEC_CLI_PM_LOG} MeasData is empty + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=4 Verify that PM Mapper throws Event failed validation against schema error when no managed element content is provided - [Tags] PM_MAPPER_09 + [Tags] PM_MAPPER_08 [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=6 Content-Type=application/xml X-DMAAP-DR-PUBLISH-ID=2 X-DMAAP-DR-META=${valid_metatdata.replace("\n","")} + ${headers}= Create Dictionary X-ONAP-RequestID=5 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}/A_no_managed_element.xml data=${no_managed_element_content} headers=${headers} VerifyResponse ${resp.status_code} 200 CheckLog ${CLI_EXEC_CLI_PM_LOG} XML validation failed - CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=6 + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=5 Verify that PM Mapper correctly identifies a file that should not be mapped based on metadata filtering. - [Tags] PM_MAPPER_10 + [Tags] PM_MAPPER_09 [Documentation] Verify that PM Mapper correctly identifies a file that should not be mapped based on metadata filtering. [Timeout] 1 minute ${cli_cmd_output}= Run Process ${CLI_EXEC_VENDOR_FILTER} shell=yes @@ -129,12 +118,12 @@ Verify that PM Mapper correctly identifies a file that should not be mapped base Should Be Equal As Strings ${cli_cmd_output.rc} 0 ${cli_cmd_output}= Run Process ${CLI_RESTART_PMMAPPER} shell=yes Sleep 10s - ${valid_meas_result_content}= Get File ${MEASD_RESULT_PATH} + ${pm_data}= Get File ${PM_DATA_FILE_PATH} ${diff_vendor_metadata}= Get File ${DIFF_VENDOR_METADATA} - ${headers}= Create Dictionary X-ONAP-RequestID=7 Content-Type=application/xml X-DMAAP-DR-PUBLISH-ID=2 X-DMAAP-DR-META=${diff_vendor_metadata.replace("\n","")} - ${resp}= Put Request mapper_session ${DELIVERY_ENDPOINT}/A_meas_result.xml data=${valid_meas_result_content} headers=${headers} + ${headers}= Create Dictionary X-ONAP-RequestID=6 Content-Type=application/xml X-DMAAP-DR-PUBLISH-ID=2 X-DMAAP-DR-META=${diff_vendor_metadata.replace("\n","")} + ${resp}= Put Request mapper_session ${DELIVERY_ENDPOINT}/A20181002.0000-1000-0015-1000_5G.xml data=${pm_data} headers=${headers} CheckLog ${CLI_EXEC_CLI_PM_LOG} Metadata does not match any filters, - CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=7 + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=6 *** Keywords *** |