diff options
author | Lasse Kaihlavirta <l.kaihlavirt@partner.samsung.com> | 2021-03-31 14:21:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-03-31 14:21:59 +0000 |
commit | 7b4a3af0a9e4a0046b303e532640bc3e4a3420e5 (patch) | |
tree | 6dcb9a3be830abb6af8b847b83b29602327a49b4 | |
parent | ddd487752cf6eddd891d7b8fe5062316a932414d (diff) | |
parent | 3d202b5a5f14587852e8519def7a07c4ca477686 (diff) |
Merge "[DMAAP] Refactoring dmaap suites"
67 files changed, 858 insertions, 1931 deletions
diff --git a/plans/dmaap-buscontroller/mock_downstream/setup.sh b/plans/dmaap-buscontroller/mock_downstream/setup.sh deleted file mode 100755 index 9f5dbbc6..00000000 --- a/plans/dmaap-buscontroller/mock_downstream/setup.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START======================================================= -# org.onap.dmaap -# ================================================================================ -# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -# -# - - -# Place the scripts in run order: -source ${WORKSPACE}/scripts/dmaap-buscontroller/start-mock.sh -start_mock "aaf" -AAF_IP=${IP} -start_mock "mrc" 3904 -MRC_IP=${IP} -start_mock "drps" -DRPS_IP=${IP} - -source ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-launch.sh -dmaapbc_launch $AAF_IP $MRC_IP $DRPS_IP -DMAAPBC_IP=${IP} - - -echo "AAF_IP=$AAF_IP MRC_IP=$MRC_IP DRPS_IP=$DRPS_IP DMAAPBC_IP=$DMAAPBC_IP" - -# Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v AAF_IP:${AAF_IP} -v MRC_IP:${MRC_IP} -v DRPS_IP:${DRPS_IP} -v DMAAPBC_IP:${DMAAPBC_IP}" - -set -x -${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-init.sh ${DMAAPBC_IP} ${DRPS_IP} ${MRC_IP} -set +x diff --git a/plans/dmaap-buscontroller/mock_downstream/teardown.sh b/plans/dmaap-buscontroller/mock_downstream/teardown.sh deleted file mode 100644 index 1b041a42..00000000 --- a/plans/dmaap-buscontroller/mock_downstream/teardown.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START======================================================= -# org.onap.dmaap -# ================================================================================ -# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -# -# -kill-instance.sh aaf-mock -kill-instance.sh drps-mock -kill-instance.sh mrc-mock -kill-instance.sh dmaapbc - diff --git a/plans/dmaap-buscontroller/mock_downstream/testplan.txt b/plans/dmaap-buscontroller/mock_downstream/testplan.txt deleted file mode 100644 index 484fb295..00000000 --- a/plans/dmaap-buscontroller/mock_downstream/testplan.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -dmaap-buscontroller/suite1 - diff --git a/plans/dmaap-buscontroller/ssl/setup.sh b/plans/dmaap-buscontroller/ssl/setup.sh deleted file mode 100755 index 6ab50ed1..00000000 --- a/plans/dmaap-buscontroller/ssl/setup.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START======================================================= -# org.onap.dmaap -# ================================================================================ -# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -# -# - - -# Place the scripts in run order: -source ${WORKSPACE}/scripts/dmaap-buscontroller/start-mock.sh -start_mock "aaf" -AAF_IP=${IP} -start_mock "mrc" 3905 -MRC_IP=${IP} -start_mock "drps" 8443 -DRPS_IP=${IP} - -source ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-launch.sh -dmaapbc_launch $AAF_IP $MRC_IP $DRPS_IP -DMAAPBC_IP=${IP} - - -echo "AAF_IP=$AAF_IP MRC_IP=$MRC_IP DRPS_IP=$DRPS_IP DMAAPBC_IP=$DMAAPBC_IP" - -# Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v AAF_IP:${AAF_IP} -v MRC_IP:${MRC_IP} -v DRPS_IP:${DRPS_IP} -v DMAAPBC_IP:${DMAAPBC_IP}" - -set -x -${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-init.sh ${DMAAPBC_IP} ${DRPS_IP} ${MRC_IP} https -set +x diff --git a/plans/dmaap-buscontroller/ssl/teardown.sh b/plans/dmaap-buscontroller/ssl/teardown.sh deleted file mode 100644 index 1b041a42..00000000 --- a/plans/dmaap-buscontroller/ssl/teardown.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START======================================================= -# org.onap.dmaap -# ================================================================================ -# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -# -# -kill-instance.sh aaf-mock -kill-instance.sh drps-mock -kill-instance.sh mrc-mock -kill-instance.sh dmaapbc - diff --git a/plans/dmaap-buscontroller/ssl/testplan.txt b/plans/dmaap-buscontroller/ssl/testplan.txt deleted file mode 100644 index 54ce4df1..00000000 --- a/plans/dmaap-buscontroller/ssl/testplan.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -dmaap-buscontroller/ssl_suite - diff --git a/plans/dmaap-buscontroller/with_dr/setup.sh b/plans/dmaap-buscontroller/with_dr/setup.sh index d9d8574f..822f6a7e 100755 --- a/plans/dmaap-buscontroller/with_dr/setup.sh +++ b/plans/dmaap-buscontroller/with_dr/setup.sh @@ -19,39 +19,27 @@ # ============LICENSE_END========================================================= # # - source ${SCRIPTS}/common_functions.sh +COMPOSE_PREFIX=${COMPOSE_PROJECT_NAME:-dockercompose} +export COMPOSE_PROJECT_NAME=$COMPOSE_PREFIX +echo "COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME" +echo "COMPOSE_PREFIX=$COMPOSE_PREFIX" -if [ "$USE_EXISTING_DMAAP" = "Y" ] -then - ROBOT_VARIABLES="-v AAF_IP:0.0.0 -v MRC_IP:0.0.0.0 -v DRPS_IP:172.17.0.3 -v DMAAPBC_IP:172.17.0.4" -else - - # Place the scripts in run order: - source ${WORKSPACE}/scripts/dmaap-buscontroller/dr-launch.sh - dmaap_dr_launch - DRPS_IP=${IP} - - #source ${WORKSPACE}/scripts/dmaap-buscontroller/start-mock.sh - #start_mock "aaf" - #AAF_IP=${IP} - AAF_IP=0.0.0.0 - #start_mock "drps" - #DRPS_IP=${IP} - MRC_IP=0.0.0.0 - - source ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-launch.sh - dmaapbc_launch $AAF_IP $MRC_IP $DRPS_IP - DMAAPBC_IP=${IP} +source ${WORKSPACE}/scripts/dmaap-datarouter/datarouter-launch.sh +# Launch DR. If true is passed, 2 subscriber containers are also deployed, else false. +dmaap_dr_launch false +DRPS_IP=${DR_PROV_IP} +source ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-launch.sh +dmaapbc_launch ${DRPS_IP} +DMAAPBC_IP=${DMAAP_BC_IP} - echo "AAF_IP=$AAF_IP MRC_IP=$MRC_IP DRPS_IP=$DRPS_IP DMAAPBC_IP=$DMAAPBC_IP" +echo "DRPS_IP=$DRPS_IP DMAAPBC_IP=$DMAAPBC_IP" - # Pass any variables required by Robot test suites in ROBOT_VARIABLES - ROBOT_VARIABLES="-v AAF_IP:${AAF_IP} -v MRC_IP:${MRC_IP} -v DRPS_IP:${DRPS_IP} -v DMAAPBC_IP:${DMAAPBC_IP}" - set -x - ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-init.sh ${DMAAPBC_IP} ${DRPS_IP} ${MRC_IP} https - set +x -fi +# Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_VARIABLES="-v DRPS_IP:${DRPS_IP} -v DMAAPBC_IP:${DMAAPBC_IP}" +set -x +${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-init.sh ${DMAAPBC_IP} +set +x diff --git a/plans/dmaap-buscontroller/with_dr/teardown.sh b/plans/dmaap-buscontroller/with_dr/teardown.sh index c7a2d6d8..5e801423 100755 --- a/plans/dmaap-buscontroller/with_dr/teardown.sh +++ b/plans/dmaap-buscontroller/with_dr/teardown.sh @@ -18,9 +18,17 @@ # limitations under the License. # ============LICENSE_END========================================================= -if [ "$KEEP_DMAAP" != "Y" ] -then -kill-instance.sh dmaapbc -cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources -docker-compose down -v -fi +#kill-instance.sh dmaapbc +cd ${WORKSPACE}/archives/dmaap/dr +rm -rf last_run_logs/* +docker cp datarouter-prov:/opt/app/datartr/logs last_run_logs/prov_logs +docker cp datarouter-node:/opt/app/datartr/logs last_run_logs/node_event_logs +docker cp datarouter-node:/var/log/onap/datarouter last_run_logs/node_server_logs +docker cp subscriber-node:/var/log/onap/datarouter last_run_logs/sub1_logs +docker cp subscriber-node2:/var/log/onap/datarouter last_run_logs/sub2_logs +docker cp dmaap-bc:/opt/app/dmaapbc/logs/ONAP last_run_logs/bc_logs + +sudo sed -i".bak" '/dmaap-dr-prov/d' /etc/hosts +sudo sed -i".bak" '/dmaap-dr-node/d' /etc/hosts +docker-compose -f ${WORKSPACE}/scripts/dmaap-datarouter/docker-compose/docker-compose.yml rm -sf +docker-compose -f ${WORKSPACE}/scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml rm -sf diff --git a/plans/dmaap-buscontroller/with_mr/setup.sh b/plans/dmaap-buscontroller/with_mr/setup.sh index 01636867..74bfb0c5 100755 --- a/plans/dmaap-buscontroller/with_mr/setup.sh +++ b/plans/dmaap-buscontroller/with_mr/setup.sh @@ -19,36 +19,21 @@ # ============LICENSE_END========================================================= # # +# Place the scripts in run order: +source ${WORKSPACE}/scripts/dmaap-message-router/dmaap-mr-launch.sh +dmaap_mr_launch +MRC_IP=${IP} -if [ "$USE_EXISTING_DMAAP" = "Y" ] -then - ROBOT_VARIABLES="-v AAF_IP:0.0.0 -v MRC_IP:172.18.0.3 -v DRPS_IP:0.0.0.0 -v DMAAPBC_IP:172.17.0.4" -else +mkdir -p ${WORKSPACE}/archives/dmaapmr/last_run_logs - # Place the scripts in run order: - source ${WORKSPACE}/scripts/dmaap-message-router/dmaap-mr-launch.sh - dmaap_mr_launch - MRC_IP=${IP} +source ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-launch.sh +dmaapbc_launch $MRC_IP +DMAAP_BC_IP=${DMAAP_BC_IP} - source ${WORKSPACE}/scripts/dmaap-buscontroller/start-mock.sh - start_mock "aaf" - AAF_IP=${IP} - #AAF_IP=0.0.0.0 - #start_mock "drps" - #DRPS_IP=${IP} - DRPS_IP=0.0.0.0 - - source ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-launch.sh - dmaapbc_launch $AAF_IP $MRC_IP $DRPS_IP - DMAAPBC_IP=${IP} - - - echo "AAF_IP=$AAF_IP MRC_IP=$MRC_IP DRPS_IP=$DRPS_IP DMAAPBC_IP=$DMAAPBC_IP" - - # Pass any variables required by Robot test suites in ROBOT_VARIABLES - ROBOT_VARIABLES="-v AAF_IP:${AAF_IP} -v MRC_IP:${MRC_IP} -v DRPS_IP:${DRPS_IP} -v DMAAPBC_IP:${DMAAPBC_IP}" - set -x - ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-init.sh ${DMAAPBC_IP} ${DRPS_IP} ${MRC_IP} - set +x -fi +echo "DMAAP_BC_IP=$DMAAP_BC_IP" +# Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_VARIABLES=" -v DMAAP_BC_IP:${DMAAP_BC_IP}" +set -x +${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-init.sh ${DMAAP_BC_IP} +set +x diff --git a/plans/dmaap-buscontroller/with_mr/teardown.sh b/plans/dmaap-buscontroller/with_mr/teardown.sh index ae064814..5149743a 100644 --- a/plans/dmaap-buscontroller/with_mr/teardown.sh +++ b/plans/dmaap-buscontroller/with_mr/teardown.sh @@ -19,12 +19,12 @@ # ============LICENSE_END========================================================= # # +cd ${WORKSPACE}/archives/dmaapmr source ${WORKSPACE}/scripts/dmaap-message-router/dmaap-mr-teardown.sh - -if [ "$KEEP_DMAAP" != "Y" ] -then dmaap_mr_teardown -kill-instance.sh dmaapbc -kill-instance.sh aaf-mock -fi +rm -rf last_run_logs/* +docker cp dmaap-bc:/opt/app/dmaapbc/logs/ONAP last_run_logs/bc_logs +docker-compose -f ${WORKSPACE}/scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml rm -sf + + diff --git a/plans/dmaap-buscontroller/with_mr/testplan.txt b/plans/dmaap-buscontroller/with_mr/testplan.txt index 0728bd44..a8fe876a 100644 --- a/plans/dmaap-buscontroller/with_mr/testplan.txt +++ b/plans/dmaap-buscontroller/with_mr/testplan.txt @@ -1,3 +1,3 @@ # Test suites are relative paths under [integration/csit.git]/tests/. # Place the suites in run order. -dmaap-buscontroller/single-mr-suite +dmaap-buscontroller/with_mr diff --git a/plans/dmaap-datarouter/ssl-dr-suite/teardown.sh b/plans/dmaap-datarouter/ssl-dr-suite/teardown.sh index 7ffd1fe2..536863bc 100755 --- a/plans/dmaap-datarouter/ssl-dr-suite/teardown.sh +++ b/plans/dmaap-datarouter/ssl-dr-suite/teardown.sh @@ -17,16 +17,5 @@ # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END===================================================== -cd ${WORKSPACE}/archives/dmaap/dr -rm -rf last_run_logs/* -docker cp datarouter-prov:/opt/app/datartr/logs last_run_logs/prov_logs -docker cp datarouter-node:/opt/app/datartr/logs last_run_logs/node_event_logs -docker cp datarouter-node:/var/log/onap/datarouter last_run_logs/node_server_logs -docker cp subscriber-node:/var/log/onap/datarouter last_run_logs/sub1_logs -docker cp subscriber-node2:/var/log/onap/datarouter last_run_logs/sub2_logs -cd ${WORKSPACE}/scripts/dmaap-datarouter/docker-compose -sudo sed -i".bak" '/dmaap-dr-prov/d' /etc/hosts -sudo sed -i".bak" '/dmaap-dr-node/d' /etc/hosts -docker-compose rm -sf -cd ${WORKSPACE}/scripts/dmaap-datarouter/robot_ssl -python -c 'import update_ca; update_ca.remove_onap_ca_cert()' +source ${WORKSPACE}/scripts/dmaap-datarouter/datarouter-teardown.sh +teardown_dmaap_dr
\ No newline at end of file diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/A20181002.0000-1000-0015-1000_5G.xml.gz b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/A20181002.0000-1000-0015-1000_5G.xml.gz Binary files differdeleted file mode 100644 index 32865fc1..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/A20181002.0000-1000-0015-1000_5G.xml.gz +++ /dev/null diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs-initializer.json b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs-initializer.json deleted file mode 100644 index 25816a50..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs-initializer.json +++ /dev/null @@ -1,95 +0,0 @@ -[{ - "httpRequest":{ - "method":"GET", - "path":"/service_component/pmmapper", - "headers":{ - "!X-ONAP-RequestID":[ - "!12345" - ], - "!X-ONAP-InvocationID":[ - "!12345" - ], - "X-ONAP-PartnerName":[ - "pm-mapper" - ], - "User-Agent":[ - "Java/11.0.7" - ], - "Host":[ - "!some-random-host:10000" - ], - "Accept":[ - "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" - ], - "Connection":[ - "keep-alive" - ], - "content-length":[ - "0" - ] - }, - "keepAlive":true, - "secure":false - }, - "httpResponse":{ - "statusCode":200, - "headers":{ - "content-type":[ - "application/json" - ] - }, - "body":{ - "type":"JSON", - "json":{ - "pm-mapper-filter":"{\"filters\": []}", - "key_store_path":"/opt/app/pm-mapper/etc/cert.jks", - "key_store_pass_path":"/opt/app/pm-mapper/etc/jks.pass", - "trust_store_path":"/opt/app/pm-mapper/etc/trust.jks", - "trust_store_pass_path":"/opt/app/pm-mapper/etc/trust.pass", - "dmaap_dr_delete_endpoint":"https://dmaap-dr-node:8443/delete", - "dmaap_dr_feed_name":"1", - "aaf_identity":"aaf_admin@people.osaaf.org", - "aaf_password":"demo123456!", - "enable_http":true, - "streams_publishes":{ - "dmaap_publisher":{ - "type":"message_router", - "dmaap_info":{ - "topic_url":"http://dmaap-message-router:3904/events/org.onap.dmaap.mr.VES_PM", - "client_role":"org.onap.dcae.pmPublisher", - "location":"csit-pmmapper", - "client_id":"1562763644939" - } - } - }, - "streams_subscribes":{ - "dmaap_subscriber":{ - "type":"data_router", - "dmaap_info":{ - "username":"username", - "password":"password", - "location":"csit-pmmapper", - "delivery_url":"http://dcae-pm-mapper:8081/delivery", - "subscriber_id":1 - } - } - } - } - } - } -}, - { - "httpRequest": { - "path": "/health" - }, - "httpResponse": { - "statusCode": 200, - "headers": { - "content-type": [ - "application/json" - ] - }, - "body": "{}" - } - } -] diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs_mockserver.properties b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs_mockserver.properties deleted file mode 100644 index 8c29348a..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs_mockserver.properties +++ /dev/null @@ -1,26 +0,0 @@ -####################################### -# MockServer & Proxy Example Settings # -####################################### - -# Socket & Port Settings - -# socket timeout in milliseconds (default 120000) -mockserver.maxSocketTimeout=120000 - -# Certificate Generation - -# delete KeyStore file on JVM shutdown (default true) -mockserver.deleteGeneratedKeyStoreOnExit=true -# certificate domain name (default "localhost") -mockserver.sslCertificateDomainName=localhost -# comma separated list of domain names for Subject Alternative Name domain names (default empty list) -mockserver.sslSubjectAlternativeNameDomains=cbs-sim,config-binding-service,config-binding-service.onap -# comma separated list of ip addresses for Subject Alternative Name ips (default empty list) -mockserver.sslSubjectAlternativeNameIps=127.0.0.1 - -# CORS - -# enable CORS for MockServer REST API -mockserver.enableCORSForAPI=true -# enable CORS for all responses -mockserver.enableCORSForAllResponses=true diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/application.yaml b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/application.yaml deleted file mode 100644 index 086babc4..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/application.yaml +++ /dev/null @@ -1,26 +0,0 @@ -spring: - profiles: - active: prod -management: - endpoints: - web: - exposure: - include: "loggers,logfile,health,info,metrics" -server: - port: 8433 - ssl: - key-store-type: PKCS12 - key-store-password: ericssondfc - key-store: classpath:keystore.jks - key-password: ericssondfc - keyAlias: tomcat-localhost -logging: - level: - ROOT: ERROR - org.springframework: ERROR - org.springframework.data: ERROR - org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR - org.onap.dcaegen2.collectors.datafile: TRACE - file: /var/log/ONAP/application.log -app: - filepath: /opt/app/datafile/config/datafile_endpoints.json diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/datafile_endpoints.json b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/datafile_endpoints.json deleted file mode 100644 index c845b2db..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/datafile_endpoints.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "config": { - "//description": "This file is only used for testing purposes", - "dmaap.certificateConfig.keyCert": "/opt/app/datafile/etc/cert/cert.jks", - "dmaap.certificateConfig.keyPasswordPath": "/opt/app/datafile/etc/cert/jks.pass", - "dmaap.certificateConfig.trustedCa": "/opt/app/datafile/etc/cert/trust.jks", - "dmaap.certificateConfig.trustedCaPasswordPath": "/opt/app/datafile/etc/cert/trust.pass", - "dmaap.security.trustStorePath": "/opt/app/datafile/etc/cert/trust.jks", - "dmaap.security.trustStorePasswordPath": "/opt/app/datafile/etc/cert/trust.pass", - "dmaap.security.keyStorePath": "/opt/app/datafile/etc/cert/cert.jks", - "dmaap.security.keyStorePasswordPath": "/opt/app/datafile/etc/cert/jks.pass", - "dmaap.security.enableDmaapCertAuth": "false", - "dmaap.dmaapConsumerConfiguration.consumerGroup": "OpenDcae-c12", - "dmaap.dmaapConsumerConfiguration.consumerId": "C12", - "dmaap.dmaapConsumerConfiguration.timeoutMs": -1, - "sftp.security.strictHostKeyChecking": "true", - "streams_publishes": { - "PM_MEAS_FILES": { - "type": "data_router", - "dmaap_info": { - "username": "dradmin", - "location": "san-francisco", - "log_url": "https://dmaap-dr-prov:8443/feedlog/1", - "publisher_id": "972.360gm", - "password": "dradmin", - "publish_url": "https://dmaap-dr-prov:8443/publish/1" - } - } - }, - "streams_subscribes": { - "dmaap_subscriber": { - "dmaap_info": { - "topic_url":"http://dmaap-message-router:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT" - }, - "type": "message_router" - } - } - } -} diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/addDefaultSubscriber.json b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/addDefaultSubscriber.json deleted file mode 100644 index 6a8da842..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/addDefaultSubscriber.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "delivery":{ - "url":"http://datarouter-subscriber:7070", - "user":"LOGIN", - "password":"PASSWORD", - "use100":true - }, - "follow_redirect":false, - "metadataOnly":false, - "suspend":false, - "groupid":0, - "links":{ - "self": "https://dmaap-dr-prov/subscribe/1", - "log": "https://dmaap-dr-prov/feedlog/1", - "feed": "https://dmaap-dr-prov/feed/1" - }, - "subscriber":"admin", - "decompress":true - }
\ No newline at end of file diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/addPmMapperSubscriber.json b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/addPmMapperSubscriber.json deleted file mode 100644 index 0666a7d5..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/addPmMapperSubscriber.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "delivery":{ - "url":"http://dcae-pm-mapper:8081/delivery", - "user":"username", - "password":"password", - "use100":true - }, - "follow_redirect":false, - "metadataOnly":false, - "suspend":false, - "groupid":0, - "links":{ - "self": "https://dmaap-dr-prov/subscribe/1", - "log": "https://dmaap-dr-prov/feedlog/1", - "feed": "https://dmaap-dr-prov/feed/1" - }, - "subscriber":"pmmapper", - "decompress":true, - "privilegedSubscriber": true - }
\ No newline at end of file diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/createFeed.json b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/createFeed.json deleted file mode 100644 index fdcc7eef..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/createFeed.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "DefaultFeed", - "version": "m1.0", - "description": "Default feed", - "business_description": "Default Feed", - "suspend": false, - "deleted": false, - "changeowner": true, - "authorization": { - "classification": "unclassified", - "endpoint_addrs": [], - "endpoint_ids": [ - { - "password": "dradmin", - "id": "dradmin" - }] - } - }
\ No newline at end of file diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/cert.jks b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/cert.jks Binary files differdeleted file mode 100644 index 33dc9a31..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/cert.jks +++ /dev/null diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/jks.pass b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/jks.pass deleted file mode 100644 index ae8f7e72..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/jks.pass +++ /dev/null @@ -1 +0,0 @@ -Er1tmip;T4w[%1}YE?x{fN9v
\ No newline at end of file diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/trust.jks b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/trust.jks Binary files differdeleted file mode 100644 index 679c95a5..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/trust.jks +++ /dev/null diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/trust.pass b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/trust.pass deleted file mode 100644 index d3d01b0a..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/trust.pass +++ /dev/null @@ -1 +0,0 @@ -583Ls;XF(qDQu3p!L22gyh1t
\ No newline at end of file diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-e2e.yml b/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-e2e.yml deleted file mode 100644 index 46fab55c..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-e2e.yml +++ /dev/null @@ -1,155 +0,0 @@ -version: '2.1' -services: - datarouter-prov: - image: nexus3.onap.org:10001/onap/dmaap/datarouter-prov:latest - container_name: dmaap-datarouter-prov - hostname: dmaap-dr-prov - ports: - - "443:8443" - - "8443:8443" - - "8080:8080" - volumes: - - ../prov_data/provserver.properties:/opt/app/datartr/etc/provserver.properties - - ../prov_data/addSubscriber.txt:/opt/app/datartr/addSubscriber.txt - - ../prov_data/addFeed3.txt:/opt/app/datartr/addFeed3.txt - depends_on: - mariadb_container: - condition: service_healthy - healthcheck: - test: ["CMD", "curl", "-f", "http://dmaap-dr-prov:8080/internal/prov"] - interval: 10s - timeout: 10s - retries: 5 - networks: - tmp_bulk-pm-network: - aliases: - - datarouter-prov - - dmaap-dr-prov - - datarouter-node: - image: nexus3.onap.org:10001/onap/dmaap/datarouter-node:latest - container_name: dmaap-datarouter-node - hostname: dmaap-dr-node - ports: - - "9443:8443" - - "9090:8080" - volumes: - - ../node_data/node.properties:/opt/app/datartr/etc/node.properties - depends_on: - datarouter-prov: - condition: service_healthy - networks: - tmp_bulk-pm-network: - aliases: - - datarouter-node - - dmaap-dr-node - - datarouter-subscriber: - image: nexus3.onap.org:10001/onap/dmaap/datarouter-subscriber:latest - container_name: fileconsumer-node - hostname: subscriber.com - ports: - - "7070:7070" - volumes: - - ../subscriber_data/subscriber.properties:/opt/app/subscriber/etc/subscriber.properties - networks: - tmp_bulk-pm-network: - aliases: - - datarouter-subscriber - - mariadb_container: - image: mariadb:10.2.14 - container_name: dmaap-dr-prov-mariadb - ports: - - "3306:3306" - environment: - MYSQL_ROOT_PASSWORD: datarouter - MYSQL_DATABASE: datarouter - MYSQL_USER: datarouter - MYSQL_PASSWORD: datarouter - healthcheck: - test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "--silent"] - interval: 10s - timeout: 30s - retries: 5 - networks: - tmp_bulk-pm-network: - aliases: - - datarouter-mariadb - - sftp: - container_name: sftp - image: atmoz/sftp - ports: - - "2222:22" - command: admin:admin:1001 - networks: - tmp_bulk-pm-network: - aliases: - - sftp - - ves: - container_name: dcaegen2-vescollector - image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.4.4 - environment: - DMAAPHOST: dmaap-message-router - networks: - tmp_bulk-pm-network: - aliases: - - dcaegen2-ves-collector - - dfc: - container_name: dcaegen2-datafile-collector - image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.datafile.datafile-app-server:latest - ports: - - "8433:8433" - volumes: - - ./dfc/application.yaml:/opt/app/datafile/config/application.yaml - - ./dfc/datafile_endpoints.json:/opt/app/datafile/config/datafile_endpoints.json - networks: - tmp_bulk-pm-network: - aliases: - - dcaegen2-datafile-collector - environment: - KNOWN_HOSTS_FILE_PATH: "/home/datafile/.ssh/known_hosts" - CONFIG_BINDING_SERVICE_SERVICE_PORT: 10000 - - cbs-sim: - container_name: config-binding-service-sim - image: mockserver/mockserver:mockserver-5.10.0 - environment: - MOCKSERVER_PROPERTY_FILE: /config/mockserver.properties - MOCKSERVER_INITIALIZATION_JSON_PATH: /config/cbs-initializer.json - LOG_LEVEL: "DEBUG" - SERVER_PORT: 10000 - volumes: - - ./cbs_sim/cbs_mockserver.properties:/config/mockserver.properties - - ./cbs_sim/cbs-initializer.json:/config/cbs-initializer.json - networks: - tmp_bulk-pm-network: - aliases: - - config-binding-service - - pmmapper: - container_name: dcaegen2-pm-mapper - image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pm-mapper:latest - ports: - - "8081:8081" - volumes: - - ./pm_mapper_certs/cert.jks:/opt/app/pm-mapper/etc/cert.jks:ro - - ./pm_mapper_certs/jks.pass:/opt/app/pm-mapper/etc/jks.pass:ro - - ./pm_mapper_certs/trust.jks:/opt/app/pm-mapper/etc/trust.jks:ro - - ./pm_mapper_certs/trust.pass:/opt/app/pm-mapper/etc/trust.pass:ro - environment: - CONFIG_BINDING_SERVICE_SERVICE_HOST: config-binding-service - CONFIG_BINDING_SERVICE_SERVICE_PORT: 10000 - HOSTNAME: pmmapper - networks: - tmp_bulk-pm-network: - aliases: - - dcae-pm-mapper - -networks: - tmp_bulk-pm-network: - external: true - diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-mr.yml b/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-mr.yml deleted file mode 100644 index ba30f280..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-mr.yml +++ /dev/null @@ -1,77 +0,0 @@ -version: '2.1' -services: - zookeeper: - container_name: dmaap-message-router-zookeeper - image: nexus3.onap.org:10001/onap/dmaap/zookeeper:6.0.3 - ports: - - "2181:2181" - environment: - ZOOKEEPER_REPLICAS: 1 - ZOOKEEPER_TICK_TIME: 2000 - ZOOKEEPER_SYNC_LIMIT: 5 - ZOOKEEPER_INIT_LIMIT: 10 - ZOOKEEPER_MAX_CLIENT_CNXNS: 200 - ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT: 3 - ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: 24 - ZOOKEEPER_CLIENT_PORT: 2181 - KAFKA_OPTS: -Djava.security.auth.login.config=/etc/zookeeper/secrets/jaas/zk_server_jaas.conf -Dzookeeper.kerberos.removeHostFromPrincipal=true -Dzookeeper.kerberos.removeRealmFromPrincipal=true -Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider -Dzookeeper.requireClientAuthScheme=sasl - ZOOKEEPER_SERVER_ID: 1 - volumes: - - ../zk/zk_server_jaas.conf:/etc/zookeeper/secrets/jaas/zk_server_jaas.conf - networks: - bulk-pm-network: - aliases: - - zookeeper - - kafka: - container_name: dmaap-message-router-kafka - image: nexus3.onap.org:10001/onap/dmaap/kafka111:1.0.4 - ports: - - "9092:9092" - environment: - enableCadi: 'false' - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 40000 - KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS: 40000 - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT - KAFKA_ADVERTISED_LISTENERS: INTERNAL_PLAINTEXT://kafka:9092 - KAFKA_LISTENERS: INTERNAL_PLAINTEXT://0.0.0.0:9092 - KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL_PLAINTEXT - KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE: 'false' - KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/jaas/zk_client_jaas.conf - KAFKA_ZOOKEEPER_SET_ACL: 'true' - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 - # Reduced the number of partitions only to avoid the timeout error for the first subscribe call in slow environment - KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 1 - volumes: - - ../kafka/zk_client_jaas.conf:/etc/kafka/secrets/jaas/zk_client_jaas.conf - networks: - bulk-pm-network: - aliases: - - kafka - depends_on: - - zookeeper - - dmaap-message-router: - container_name: dmaap-message-router-server - image: nexus3.onap.org:10001/onap/dmaap/dmaap-mr:1.1.18 - ports: - - "3904:3904" - - "3905:3905" - environment: - enableCadi: 'false' - volumes: - - ../mr/MsgRtrApi.properties:/appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties - - ../mr/logback.xml:/appl/dmaapMR1/bundleconfig/etc/logback.xml - - ../mr/cadi.properties:/appl/dmaapMR1/etc/cadi.properties - networks: - bulk-pm-network: - aliases: - - dmaap-message-router - depends_on: - - zookeeper - - kafka - -networks: - bulk-pm-network: - driver: bridge diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/setup.sh b/plans/usecases-5G-bulkpm/5G-bulkpm/setup.sh deleted file mode 100644 index 8cb3d9f8..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/setup.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/bash -# Place the scripts in run order: -source ${SCRIPTS}/common_functions.sh - -# Clone DMaaP Message Router repo -mkdir -p $WORKSPACE/archives/dmaapmr -cd $WORKSPACE/archives/dmaapmr -git clone --depth 1 http://gerrit.onap.org/r/dmaap/messagerouter/messageservice -b master -mkdir $WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose/tmp/ -# Copy custom docker-compose file -cp $WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-mr.yml \ -$WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose/tmp/docker-compose-mr.yml - -# Login to onap docker -docker login -u docker -p docker nexus3.onap.org:10001 -# Start DMaaP MR containers with docker compose and configuration from docker-compose-mr.yml -docker-compose -f $WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose/tmp/docker-compose-mr.yml up -d -sleep 5 - -# Wait for initialization of Docker contaienr for DMaaP MR, Kafka and Zookeeper -for i in 1 2 3 4 5 6 7 8 9 10; do - if [[ $(docker inspect --format '{{ .State.Running }}' dmaap-message-router-kafka) ]] && \ - [[ $(docker inspect --format '{{ .State.Running }}' dmaap-message-router-zookeeper) ]] && \ - [[ $(docker inspect --format '{{ .State.Running }}' dmaap-message-router-server) ]] - then - echo "Message Router service running" - break - else - echo sleep ${i} - sleep ${i} - fi -done - -# Clone DMaaP Data Router repo -mkdir -p $WORKSPACE/archives/dmaapdr -cd $WORKSPACE/archives/dmaapdr -git clone --depth 1 https://gerrit.onap.org/r/dmaap/datarouter -b master -mkdir $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose - -# Copy e2e docker compose assets to tmp dir -cp $WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-e2e.yml \ -$WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/docker-compose-e2e.yml -cp -rf $WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/ \ -$WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/ -cp -rf $WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/ \ -$WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/ -cp -rf $WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/ \ -$WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/ - -# Start cbs-sim for pmmapper stability -docker-compose -f $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/docker-compose-e2e.yml up -d cbs-sim -echo "Starting cbs-sim" -sleep 10 - -# Start the rest of the e2e containers -docker-compose -f $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/docker-compose-e2e.yml up -d - -# Wait for initialization of the following containers -for i in 1 2 3 4 5 6 7 8 9 10; do - if [[ $(docker inspect --format '{{ .State.Running }}' dmaap-datarouter-node) ]] && \ - [[ $(docker inspect --format '{{ .State.Running }}' dmaap-datarouter-prov) ]] && \ - [[ $(docker inspect --format '{{ .State.Running }}' dmaap-dr-prov-mariadb) ]] && \ - [[ $(docker inspect --format '{{ .State.Running }}' dcaegen2-pm-mapper) ]] && \ - [[ $(docker inspect --format '{{ .State.Running }}' dcaegen2-datafile-collector) ]] - then - echo "Data Router service running" - break - else - echo sleep ${i} - sleep ${i} - fi -done - -# Get IP address of docker-host, dmaap-dr-prov, dmaap-dr-gateway, dmaap-mr and ves collector. -#HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $7}') -DR_PROV_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dmaap-datarouter-prov) -DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' dmaap-datarouter-prov) -DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dmaap-message-router-server) -VESC_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dcaegen2-vescollector) - -#Add SFTP server pubilc key to known hosts of datafile collector -HOST_NAMES=$(docker inspect -f '{{ range .NetworkSettings.Networks}}{{join .Aliases ","}}{{end}}' sftp) -KEY_ENTRY=$(echo $HOST_NAMES "$(docker exec sftp cat /etc/ssh/ssh_host_rsa_key.pub)" | sed -e 's/\w*@\w*$//') -docker exec -i -u root dcaegen2-datafile-collector sh -c "echo $KEY_ENTRY >> /home/datafile/.ssh/known_hosts" - -# Add gateway IP to DR Prov -docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$DR_GATEWAY_IP" -docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$DR_GATEWAY_IP" - -#Increase DFC Logging -#docker exec dfc /bin/sh -c " sed -i 's/org.onap.dcaegen2.collectors.datafile: WARN/org.onap.dcaegen2.collectors.datafile: TRACE/g' /opt/app/datafile/config/application.yaml" - -# Copy sample PM file to sftp server -docker cp $WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/assets/A20181002.0000-1000-0015-1000_5G.xml.gz sftp:/home/admin/ - -# Data Router Configuration: -# Create default feed on DMaaP data router -curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF:dradmin" \ ---data-ascii @$WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/createFeed.json --post301 \ ---location-trusted -k https://${DR_PROV_IP}:8443 -sleep 2 -# Create file consumer subscriber on DMaaP data router -curl -X POST -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:dradmin" \ ---data-ascii @$WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/addDefaultSubscriber.json --post301 \ ---location-trusted -k https://${DR_PROV_IP}:8443/subscribe/1 -sleep 2 -# Add PM Mapper subscriber on data router feed -curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" \ ---data-ascii @$WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/addPmMapperSubscriber.json \ ---post301 --location-trusted -k https://${DR_PROV_IP}:8443/subscribe/1 - -# Check DMaaP DR provisioning -curl -k https://${DR_PROV_IP}:8443/internal/prov - -# Add necessary python libs -pip install jsonschema uuid simplejson - -# Export necessary vars -export VESC_IP=${VESC_IP} -export VESC_PORT=8080 -export DMAAP_MR_IP=${DMAAP_MR_IP} - -#Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v VESC_IP:${VESC_IP} -v VESC_PORT:${VESC_PORT}" diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/teardown.sh b/plans/usecases-5G-bulkpm/5G-bulkpm/teardown.sh deleted file mode 100644 index 04391bbf..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/teardown.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -echo "Starting teardown script" -kill-instance.sh dmaap-message-router-server -kill-instance.sh dmaap-message-router-kafka -kill-instance.sh dmaap-message-router-zookeeper -kill-instance.sh dmaap-datarouter-node -kill-instance.sh dmaap-datarouter-prov -kill-instance.sh dmaap-dr-prov-mariadb -kill-instance.sh fileconsumer-node -kill-instance.sh dcaegen2-vescollector -kill-instance.sh dcaegen2-datafile-collector -kill-instance.sh dcaegen2-pm-mapper -kill-instance.sh sftp -kill-instance.sh config-binding-service-sim -yes | docker network prune diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/testplan.txt b/plans/usecases-5G-bulkpm/5G-bulkpm/testplan.txt deleted file mode 100644 index b72ba90d..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -usecases-5G-bulkpm/5G-bulkpm diff --git a/scripts/dmaap-buscontroller/dmaapbc-init.sh b/scripts/dmaap-buscontroller/dmaapbc-init.sh index 804603f2..5e9cbb1e 100755 --- a/scripts/dmaap-buscontroller/dmaapbc-init.sh +++ b/scripts/dmaap-buscontroller/dmaapbc-init.sh @@ -1,56 +1,38 @@ #!/bin/bash # $1 is the IP address of the buscontroller -# $2 is the IP address of the DRPS -# $3 is the IP address of the MRC -# $4 is the protocol (defaults to http) - -PROTO=${4:-http} -if [ "$PROTO" = "http" ] -then - PORT=8080 - CURLOPT="-v" - MRPORT=3904 - DRPORT=8080 -else - PORT=8443 - CURLOPT="-v -k" - MRPORT=3905 - DRPORT=8443 -fi # INITIALIZE: dmaap object JSON=/tmp/$$.dmaap cat << EOF > $JSON { - "version": "1", - "topicNsRoot": "org.onap.dmaap", - "drProvUrl": "${PROTO}://dmaap-dr-prov:${DRPORT}", - "dmaapName": "onapCSIT", - "bridgeAdminTopic": "MM_AGENT_PROV" + "version": "1", + "topicNsRoot": "org.onap.dmaap", + "drProvUrl": "https://dmaap-dr-prov:8443", + "dmaapName": "onapCSIT", + "bridgeAdminTopic": "MM_AGENT_PROV" } EOF echo "Initializing /dmaap endpoint" -curl ${CURLOPT} -X POST -d @${JSON} -H "Content-Type: application/json" ${PROTO}://$1:${PORT}/webapi/dmaap - +curl -v -k -X POST -d @${JSON} -H "Content-Type: application/json" https://$1:8443/webapi/dmaap # INITIALIZE: dcaeLocation object JSON=/tmp/$$.loc cat << EOF > $JSON { - "dcaeLocationName": "csit-sanfrancisco", - "dcaeLayer": "central-cloud", - "clli": "CSIT12345", - "zone": "zoneA" + "dcaeLocationName": "csit-sanfrancisco", + "dcaeLayer": "central-cloud", + "clli": "CSIT12345", + "zone": "zoneA" } EOF echo "Initializing /dcaeLocations endpoint" -curl ${CURLOPT} -X POST -d @${JSON} -H "Content-Type: application/json" ${PROTO}://$1:${PORT}/webapi/dcaeLocations +curl -v -k -X POST -d @${JSON} -H "Content-Type: application/json" https://$1:8443/webapi/dcaeLocations # INITIALIZE: MR object in 1 site @@ -64,13 +46,13 @@ DOCKER_HOST=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+' | head -1 ) JSON=/tmp/$$.mrc cat << EOF > $JSON { - "dcaeLocationName": "csit-sanfrancisco", - "fqdn": "$DOCKER_HOST", - "topicProtocol" : "http", - "topicPort": "${MRPORT}" + "dcaeLocationName": "csit-sanfrancisco", + "fqdn": "message-router", + "topicProtocol" : "http", + "topicPort": "3904" } EOF echo "Initializing /mr_clusters endpoint" -curl ${CURLOPT} -X POST -d @${JSON} -H "Content-Type: application/json" ${PROTO}://$1:${PORT}/webapi/mr_clusters +curl -v -k -X POST -d @${JSON} -H "Content-Type: application/json" https://$1:8443/webapi/mr_clusters diff --git a/scripts/dmaap-buscontroller/dmaapbc-launch.sh b/scripts/dmaap-buscontroller/dmaapbc-launch.sh index 0a653fa1..3e446d89 100755 --- a/scripts/dmaap-buscontroller/dmaapbc-launch.sh +++ b/scripts/dmaap-buscontroller/dmaapbc-launch.sh @@ -4,34 +4,23 @@ # sets global var IP with assigned IP address function dmaapbc_launch() { - TAG="nexus3.onap.org:10001/onap/dmaap/buscontroller" - CONTAINER_NAME=dmaapbc - IP="" + export dmaap_prov_ip=$1 + export dmaap_mr_ip=$1 + cd ${WORKSPACE}/scripts/dmaap-buscontroller/docker-compose + docker-compose -f docker-compose-bc.yml up -d - cd ${WORKSPACE}/scripts/dmaap-buscontroller + sleep 10 - TMP_CFG=/tmp/docker-databus-controller.conf - . ./onapCSIT.env > $TMP_CFG - ADDHOSTS="" - if [ ! -z "$2" ] - then - ADDHOSTS="$ADDHOSTS --add-host=message-router:$2" - fi - if [ ! -z "$3" ] - then - ADDHOSTS="$ADDHOSTS --add-host=dmaap-dr-prov:$3" - fi - docker run -d $ADDHOSTS --name $CONTAINER_NAME -v $TMP_CFG:/opt/app/config/conf $TAG - IP=`get-instance-ip.sh ${CONTAINER_NAME}` + DMAAP_BC_IP=`get-instance-ip.sh dmaap-bc` source ${SCRIPTS}/common_functions.sh - bypass_ip_adress ${IP} + bypass_ip_adress ${DMAAP_BC_IP} - # Wait for initialization - for i in {1..10}; do - curl -sS ${IP}:8080 && break - echo sleep $i - sleep $i - done + # Wait for initialization + for i in 1 2 3 4 5 6 7 8 9 10; do + curl -sS ${DMAAP_BC_IP}:8080 && break + echo sleep ${i} + sleep ${i} + done } diff --git a/scripts/dmaap-buscontroller/docker-compose/buscontroller.env b/scripts/dmaap-buscontroller/docker-compose/buscontroller.env new file mode 100644 index 00000000..cc3a3c7d --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/buscontroller.env @@ -0,0 +1,4 @@ +DMAAPBC_WAIT_TO_EXIT=Y +DMAAPBC_PG_ENABLED=false +DMAAPBC_CSIT=Yes +DMAAPBC_KSTOREFILE=/opt/app/osaaf/local/org.onap.dmaap-bc.jks
\ No newline at end of file diff --git a/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.cred.props b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.cred.props new file mode 100644 index 00000000..52536a14 --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.cred.props @@ -0,0 +1,17 @@ +############################################################ +# Properties Generated by AT&T Certificate Manager +# by root +# on 2021-03-12T11:38:49.244+0000 +# @copyright 2019, AT&T +############################################################ +Challenge=secret +cadi_alias=dmaap-bc@dmaap-bc.onap.org +cadi_key_password=secret +#cadi_keyfile=/opt/app/osaaf/local/org.onap.dmaap-dr.keyfile +cadi_keystore=/opt/app/osaaf/local/org.onap.dmaap-bc.jks +cadi_keystore_password=secret +cadi_keystore_password_jks=secret +cadi_keystore_password_p12=secret +cadi_truststore=/opt/app/osaaf/local/truststore.jks +cadi_truststore_password=secret +cadi_x509_issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US diff --git a/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.jks b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.jks Binary files differnew file mode 100644 index 00000000..ca8301ca --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.jks diff --git a/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.location.props b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.location.props new file mode 100644 index 00000000..a8374dc7 --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.location.props @@ -0,0 +1,8 @@ +############################################################ +# Properties Generated by AT&T Certificate Manager +# by root +# on 2021-03-12T11:25:54.608+0000 +# @copyright 2019, AT&T +############################################################ +cadi_latitude=38.0 +cadi_longitude=-72.0 diff --git a/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.props b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.props new file mode 100644 index 00000000..f3747fad --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.props @@ -0,0 +1,24 @@ +############################################################ +# Properties Generated by AT&T Certificate Manager +# by root +# on 2021-03-12T11:25:54.617+0000 +# @copyright 2019, AT&T +############################################################ +aaf_env=DEV +aaf_id=dmaap-bc@dmaap-bc.onap.org +aaf_locate_url=https://aaf-locate.onap:8095 +aaf_locator_app_ns=org.osaaf.aaf +aaf_locator_container=oom +aaf_locator_container_ns=onap +aaf_locator_fqdn=dmaap-bc +aaf_locator_public_fqdn=aaf.osaaf.org +aaf_oauth2_introspect_url=https://AAF_LOCATE_URL/%CNS.%AAF_NS.introspect:2.1/introspect +aaf_oauth2_token_url=https://AAF_LOCATE_URL/%CNS.%AAF_NS.token:2.1/token +aaf_url=https://AAF_LOCATE_URL/%CNS.%AAF_NS.service:2.1 +aaf_url_cm=https://AAF_LOCATE_URL/%CNS.%AAF_NS.cm:2.1 +aaf_url_fs=https://AAF_LOCATE_URL/%CNS.%AAF_NS.fs:2.1 +aaf_url_gui=https://AAF_LOCATE_URL/%CNS.%AAF_NS.gui:2.1 +aaf_url_hello=https://aaf-locate.onap:8095/locate/onap.org.osaaf.aaf.hello:2.1 +aaf_url_oauth=https://AAF_LOCATE_URL/%CNS.%AAF_NS.oauth:2.1 +cadi_prop_files=/opt/app/osaaf/local/org.onap.dmaap-bc.location.props:/opt/app/osaaf/local/org.onap.dmaap-bc.cred.props +cadi_protocols=TLSv1.1,TLSv1.2 diff --git a/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/truststore.jks b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/truststore.jks Binary files differnew file mode 100644 index 00000000..91547c60 --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/truststore.jks diff --git a/scripts/dmaap-buscontroller/docker-compose/dmaapbc.properties b/scripts/dmaap-buscontroller/docker-compose/dmaapbc.properties new file mode 100644 index 00000000..611a172f --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/dmaapbc.properties @@ -0,0 +1,168 @@ + +##################################################### +# +# Hooks for specific environment configurations +# +##################################################### +# Indicator for whether to use AAF for authentication +UseAAF: false + +# Stub out southbound calls for Unit Test cases to run. e.g. not timeout +# Comment out in other environments to get default (No) +#UnitTest: Yes + + +##################################################### +# +# Settings for Southbound API: Datarouter +# +##################################################### + +# URI to retrieve dynamic DR configuration +ProvisioningURI: /internal/prov + +# indicator for handling feed delete: +# DeleteOnDR - means use the DR API to DELETE a feed. (default for backwards compatibility) +# SimulateDelete - means preserve the feed on DR (after cleaning it up), and mark as DELETED in DBCL. Better for cloudify environments. +Feed.deleteHandling: SimulateDelete + +########################################################### +# The following properties default to match ONAP DR instance. +# However, there are some non-ONAP DR instances that require other values. +# Sets the X-DR-ON-BEHALF-OF HTTP Header value +#DR.onBehalfHeader: +# Value for the Content-Type Header in DR Feed API +#DR.feedContentType: +# Value for the Content-Type Header in DR Subscription API +#DR.subContentType: +# +# END OF properties helpful for non-ONAP DR instance. +############################################################ + +##################################################### +# +# Settings for Soutbound API: Postgresql +# +##################################################### +# flag indicates if we are using postgresql +UsePGSQL: false + + +##################################################### +# +# Settings for Soutbound API: Message Router +# +##################################################### +# indicator for multi-site (locations) deployment. Give clue to buscontroller whether +# there is a need for message replication between edge and central. +# ONAP Casablanca is a single site deployment +MR.multisite: false + +# FQDN of primary message router. +# In ONAP Casablanca, there is only 1 message router service, so use that. +# In a multi-site, MR cluster deployment, use the CNAME DNS entry which resolves to the primary central MR +MR.CentralCname: message-router + +# Indicator for whether we want hostname verification on SSL connection to MR +MR.hostnameVerify: false + + +# MR Client Delete Level thoroughness: +# 0 = don't delete +# 1 = delete from persistent store +# 2 = delete from persistent store (DB) and authorization store (AAF) +MR.ClientDeleteLevel: 1 + +# namespace of MR Topic Factory +MR.TopicFactoryNS: org.onap.dmaap.mr.topicFactory + +# AAF Role assigned to Topic Manager Identity +MR.TopicMgrRole: org.onap.dmaap-bc-topic-mgr.client + +# MR topic ProjectID (used in certain topic name generation formats) +MR.projectID: mr + +# Use Basic Authentication when provisioning topics +MR.authentication: basicAuth + +# MR topic name style (default is FQTN_LEGACY_FORMAT) +#MR.topicStyle: FQTN_LEGACY_FORMAT +# +# end of MR Related Properties +################################################################################ + + +##################################################### +# +# Settings for Southbound API: AAF proxy +# +##################################################### +# URL of the AAF server +aaf.URL: {{ .Values.aafURL }} + +# TopicMgr Identity +aaf.TopicMgrUser: {{ .Values.topicMgrUser }} + +# Password for TopicMgr identity +aaf.TopicMgrPassword: {{ .Values.topicMgrPwd }} + +# Buscontroller Admin Identity +aaf.AdminUser: {{ .Values.adminUser }} + +# Admin Password +aaf.AdminPassword: {{ .Values.adminPwd }} + +# Identity that is owner of any created namespaces for topics +aaf.NsOwnerIdentity: {{ .Values.adminUser }} + + +# +# endof AAF Properties +#################################################### + + +##################################################### +# +# Settings for authorization of DBCAPI +# +##################################################### +# Namespace for URI values for the API used to create AAF permissions +# e.g. if ApiNamespace is X.Y.dmaapbc.api then for URI /mr_clients we create AAF perm X.Y.dmaapbc.api.mr_clients +ApiNamespace: org.onap.dmaap-bc.api + +# If API authorization is required, then implement a class to enforce it. +# This overrides the Class used for API permission check. +ApiPermission.Class: org.onap.dmaap.dbcapi.authentication.AllowAll + + +##################################################### +# +# Certificate Management +# +##################################################### + +# Indicates how we are expecting certificates to be provided: +# cadi - a set of artifacts will be downloaded from AAF at deployment time, and details will be in a cadi properties file +# legacy (default) - artifacts will be installed manually or some other way and details will be in this file +CertificateManagement: cadi + +# When CertificateManagement is cadi, then this is where all the cadi properties will be. +# Note that the cadi properties include where the cert is, and the encrypted passwords to read. +cadi.properties: /opt/app/osaaf/local/org.onap.dmaap-bc.props + + +##################################################### +# +# HTTP Server Configuration +# +##################################################### + +# Allow http access to dbcapi +HttpAllowed: true + +# listen to http port within this container (server) +IntHttpPort: 8080 + +# listen to https port within this container (server) +# set to 0 if no certificates are available. +IntHttpsPort: 8443 diff --git a/scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml b/scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml new file mode 100644 index 00000000..7357f900 --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml @@ -0,0 +1,25 @@ +version: '2.1' +services: + dmaap-bc: + container_name: dmaap-bc + hostname: dmaap-bc + image: nexus3.onap.org:10001/onap/dmaap/dmaap-bc + ports: + - "30241:8080" + - "30242:8443" + volumes: + - ./buscontroller.env:/opt/app/config/conf/buscontroller.env + - ./dmaapbc.properties:/opt/app/config/conf/dmaapbc.properties + - ./cadi_aaf:/opt/app/osaaf/local + - ./logback.xml:/opt/app/dmaapbc/etc/logback.xml + networks: + dockercompose_net: + aliases: + - dmaap-bc + extra_hosts: + - dmaap-dr-prov:$dmaap_prov_ip + - message-router:$dmaap_prov_ip + +networks: + dockercompose_net: + external: true diff --git a/scripts/dmaap-buscontroller/docker-compose/logback.xml b/scripts/dmaap-buscontroller/docker-compose/logback.xml new file mode 100644 index 00000000..9e8492b1 --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/logback.xml @@ -0,0 +1,356 @@ +<!-- + ============LICENSE_START========================================== + org.onap.dmaap + =================================================================== + Copyright © 2018 AT&T Intellectual Property. All rights reserved. + =================================================================== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END============================================ + ECOMP is a trademark and service mark of AT&T Intellectual Property. +--> + + +<configuration scan="true" scanPeriod="3 seconds"> + <!--<jmxConfigurator /> --> + <!-- directory path for all other type logs --> + <property name="logDir" value="logs" /> + + <!-- directory path for debugging type logs --> + <property name="debugDir" value="logs" /> + + <!-- specify the component name + <ECOMP-component-name>::= "MSO" | "DCAE" | "ASDC " | "AAI" |"Policy" | "SDNC" | "AC" --> + <property name="componentName" value="ONAP"></property> + + <!-- log file names --> + <property name="generalLogName" value="application" /> + <property name="securityLogName" value="security" /> + <property name="performanceLogName" value="performance" /> + <property name="serverLogName" value="server" /> + <property name="policyLogName" value="policy" /> + <property name="errorLogName" value="error" /> + <property name="metricsLogName" value="metrics" /> + <property name="auditLogName" value="audit" /> + <property name="debugLogName" value="debug" /> + + <property name="defaultPattern" value="%date{ISO8601,UTC}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{VirtualServerName}|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Timer}|%msg%n" /> + + <property name="auditLoggerPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{VirtualServerName}|%X{ServiceName}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Unused}|%X{ProcessKey}|%X{CustomField1}|%X{CustomField2}|%X{CustomField3}|%X{CustomField4}|%msg%n" /> + <property name="metricsLoggerPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{VirtualServerName}|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Unused}|%X{ProcessKey}|%X{TargetVirtualEntity}|%X{CustomField1}|%X{CustomField2}|%X{CustomField3}|%X{CustomField4}|%msg%n" /> + <property name="errorLoggerPattern" value="%date{ISO8601,UTC}|%X{RequestId}|%thread|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%.-5level|%X{ErrorCode}|%X{ErrorDescription}|%msg%n" /> + <property name="debugLoggerPattern" value="%date{ISO8601,UTC}|%X{RequestId}|%thread|%msg%n" /> + + <property name="logDirectory" value="${logDir}/${componentName}" /> + <property name="debugLogDirectory" value="${debugDir}/${componentName}" /> + + + <!-- Example evaluator filter applied against console appender --> + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>${defaultPattern}</pattern> + </encoder> + </appender> + + <!-- ============================================================================ --> + <!-- EELF Appenders --> + <!-- ============================================================================ --> + + <!-- The EELFAppender is used to record events to the general application + log --> + + + <appender name="EELF" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${generalLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${generalLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${defaultPattern}</pattern> + </encoder> + </appender> + + <appender name="asyncEELF" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELF" /> + </appender> + + <!-- EELF Security Appender. This appender is used to record security events + to the security log file. Security events are separate from other loggers + in EELF so that security log records can be captured and managed in a secure + way separate from the other logs. This appender is set to never discard any + events. --> + <appender name="EELFSecurity" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${securityLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${securityLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${defaultPattern}</pattern> + </encoder> + </appender> + + <appender name="asyncEELFSecurity" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <discardingThreshold>0</discardingThreshold> + <appender-ref ref="EELFSecurity" /> + </appender> + + <!-- EELF Performance Appender. This appender is used to record performance + records. --> + <appender name="EELFPerformance" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${performanceLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${performanceLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${defaultPattern}</pattern> + </encoder> + </appender> + <appender name="asyncEELFPerformance" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELFPerformance" /> + </appender> + + <!-- EELF Server Appender. This appender is used to record Server related + logging events. The Server logger and appender are specializations of the + EELF application root logger and appender. This can be used to segregate Server + events from other components, or it can be eliminated to record these events + as part of the application root log. --> + <appender name="EELFServer" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${serverLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${serverLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${defaultPattern}</pattern> + </encoder> + </appender> + <appender name="asyncEELFServer" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELFServer" /> + </appender> + + + <!-- EELF Policy Appender. This appender is used to record Policy engine + related logging events. The Policy logger and appender are specializations + of the EELF application root logger and appender. This can be used to segregate + Policy engine events from other components, or it can be eliminated to record + these events as part of the application root log. --> + <appender name="EELFPolicy" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${policyLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${policyLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${defaultPattern}</pattern> + </encoder> + </appender> + <appender name="asyncEELFPolicy" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELFPolicy" /> + </appender> + + + <!-- EELF Audit Appender. This appender is used to record audit engine + related logging events. The audit logger and appender are specializations + of the EELF application root logger and appender. This can be used to segregate + Policy engine events from other components, or it can be eliminated to record + these events as part of the application root log. --> + + <appender name="EELFAudit" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${auditLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${auditLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${auditLoggerPattern}</pattern> + </encoder> + </appender> + <appender name="asyncEELFAudit" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELFAudit" /> + </appender> + +<appender name="EELFMetrics" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${metricsLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${metricsLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${metricsLoggerPattern}</pattern> + </encoder> + </appender> + + + <appender name="asyncEELFMetrics" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELFMetrics"/> + </appender> + + <appender name="EELFError" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${errorLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${errorLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${errorLoggerPattern}</pattern> + </encoder> + </appender> + + <appender name="asyncEELFError" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELFError"/> + </appender> + + <appender name="EELFDebug" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${debugLogDirectory}/${debugLogName}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${debugLogDirectory}/${debugLogName}.%i.log.zip + </fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${debugLoggerPattern}</pattern> + </encoder> + </appender> + + <appender name="asyncEELFDebug" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>256</queueSize> + <appender-ref ref="EELFDebug" /> + <includeCallerData>true</includeCallerData> + </appender> + + + <!-- ============================================================================ --> + <!-- EELF loggers --> + <!-- ============================================================================ --> + <logger name="com.att.eelf" level="info" additivity="false"> + <appender-ref ref="asyncEELF" /> + </logger> + <logger name="com.att.eelf.security" level="info" additivity="false"> + <appender-ref ref="asyncEELFSecurity" /> + </logger> + <logger name="com.att.eelf.perf" level="info" additivity="false"> + <appender-ref ref="asyncEELFPerformance" /> + </logger> + <logger name="com.att.eelf.server" level="info" additivity="false"> + <appender-ref ref="asyncEELFServer" /> + </logger> + <logger name="com.att.eelf.policy" level="info" additivity="false"> + <appender-ref ref="asyncEELFPolicy" /> + </logger> + + <logger name="com.att.eelf.audit" level="info" additivity="false"> + <appender-ref ref="asyncEELFAudit" /> + </logger> + + <logger name="com.att.eelf.metrics" level="info" additivity="false"> + <appender-ref ref="asyncEELFMetrics" /> + </logger> + + + <logger name="com.att.eelf.error" level="error" additivity="false"> + <appender-ref ref="asyncEELFError" /> + </logger> + + <logger name="com.att.eelf.debug" level="debug" additivity="false"> + <appender-ref ref="asyncEELFDebug" /> + </logger> + + + + + <root level="TRACE"> + <appender-ref ref="asyncEELF" /> + </root> + +</configuration> diff --git a/scripts/dmaap-buscontroller/dr-launch.sh b/scripts/dmaap-buscontroller/dr-launch.sh deleted file mode 100644 index bba1b73d..00000000 --- a/scripts/dmaap-buscontroller/dr-launch.sh +++ /dev/null @@ -1,58 +0,0 @@ - -#!/bin/bash - -#!/bin/bash - -# script to launch DMaaP DR docker containers -# sets global var IP with assigned IP address of DR Prov - -function dmaap_dr_launch() { - IP="" - - - # This next section was copied from scripts/dmaap-datarouter/dr-suite/setup.sh - # and slightly modified... - - # Clone DMaaP Data Router repo - mkdir -p $WORKSPACE/archives/dmaapdr - cd $WORKSPACE/archives/dmaapdr - - git clone --depth 1 https://gerrit.onap.org/r/dmaap/datarouter -b master - cd datarouter - git pull - cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources - - # start DMaaP DR containers with docker compose and configuration from docker-compose.yml - docker login -u docker -p docker nexus3.onap.org:10001 - docker-compose up -d - - # Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb - for i in {1..50}; do - if [ $(docker inspect --format '{{ .State.Running }}' datarouter-node) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' datarouter-prov) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' mariadb) ] - then - echo "DR Service Running" - break - else - echo sleep $i - sleep $i - fi - done - - DR_PROV_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-prov) - DR_NODE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-node) - DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' datarouter-prov) - - echo DR_PROV_IP=${DR_PROV_IP} - echo DR_NODE_IP=${DR_NODE_IP} - echo DR_GATEWAY_IP=${DR_GATEWAY_IP} - - docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$DR_GATEWAY_IP" - docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$DR_GATEWAY_IP" - - #Pass any variables required by Robot test suites in ROBOT_VARIABLES - ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DR_NODE_IP:${DR_NODE_IP}" - - IP=${DR_GATEWAY_IP} -} diff --git a/scripts/dmaap-buscontroller/init-mock-aaf.sh b/scripts/dmaap-buscontroller/init-mock-aaf.sh deleted file mode 100755 index f25404ce..00000000 --- a/scripts/dmaap-buscontroller/init-mock-aaf.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -# $1 is the IP address of the AAF mock server - -#curl -v -X PUT -d @- http://$1:1080/expectation << EOF -#{ -# "httpRequest": { -# "method": "GET", -# "path": "/hello" -# }, -# "httpResponse": { -# "body": "Hello world!", -# "statusCode": 200 -# }, -# "times" : { -# "unlimited" : true -# } -#} -#EOF -# "httpRequest": { -# "method": "POST", -# "path": "/proxy/authz/.*" -# }, - -curl -v -X PUT -d @- http://$1:1080/expectation << EOF -{ - "httpRequest": { - "method": ".*", - "path": "/.*" - }, - "httpResponse": { - "body": "Hello world!", - "statusCode": 200 - }, - "times" : { - "unlimited" : true - } -} -EOF - -#curl -v -X PUT -d @- http://$1:1080/expectation << EOF -#{ -# "httpRequest": { -# "method": "POST", -# "path": "/proxy/authz/role/perm" -# }, -# "httpResponse": { -# "body": "Hello world!", -# "statusCode": 200 -# } -#} -#EOF - diff --git a/scripts/dmaap-buscontroller/init-mock-drps.sh b/scripts/dmaap-buscontroller/init-mock-drps.sh deleted file mode 100755 index e0f1d0f1..00000000 --- a/scripts/dmaap-buscontroller/init-mock-drps.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# $1 is the IP address of the DRPS (Data Router Provisioning Server) mock server - -curl -v -X PUT -d @- http://$1:1080/expectation << EOF -{ - "httpRequest": { - "method": "GET", - "path": "/hello" - }, - "httpResponse": { - "body": "Hello world!", - "statusCode": 200 - } -} -EOF - diff --git a/scripts/dmaap-buscontroller/init-mock-mrc.sh b/scripts/dmaap-buscontroller/init-mock-mrc.sh deleted file mode 100755 index 75c1a419..00000000 --- a/scripts/dmaap-buscontroller/init-mock-mrc.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# $1 is the IP address of the MRC (MR Central) mock server - -curl -v -X PUT -d @- http://$1:1080/expectation << EOF -{ - "httpRequest": { - "method": "GET", - "path": "/hello" - }, - "httpResponse": { - "body": "Hello world!", - "statusCode": 200 - } -} -EOF - diff --git a/scripts/dmaap-buscontroller/onapCSIT.env b/scripts/dmaap-buscontroller/onapCSIT.env deleted file mode 100644 index db865818..00000000 --- a/scripts/dmaap-buscontroller/onapCSIT.env +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# environment settings for Dmaap Bus Controller Integration Test. -# assumes args are: -# $1 - FQDN of AAF server -# $2 - FQDN of MR server -# $3 - FQDN of DRPS Server -# Only need to set values where defaults aren't appropriate -# -cat <<!EOF -DMAAPBC_INT_HTTPS_PORT=8443 -DMAAPBC_PG_ENABLED=false -DMAAPBC_INSTANCE_NAME=ONAP-CSIT -DMAAPBC_AAF_URL=https://${1}:1080/proxy/ -DMAAPBC_MR_CNAME=${2} -DMAAPBC_DRPROV_FQDN=${3} -DMAAPBC_CSIT=Yes -!EOF diff --git a/scripts/dmaap-buscontroller/start-mock.sh b/scripts/dmaap-buscontroller/start-mock.sh deleted file mode 100755 index cd986061..00000000 --- a/scripts/dmaap-buscontroller/start-mock.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START======================================================= -# org.onap.dmaap -# ================================================================================ -# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -# -# - -# -# starts a mock server container named $1-mock -# and runs init-mock-$1.sh to initialize it -# modifies global var IP to provide the IP address of the started container -function start_mock() { - IP="" - app=$1 - port=${2:-1080} - docker run --name ${app}-mock -d jamesdbloom/mockserver /opt/mockserver/run_mockserver.sh -logLevel INFO -serverPort ${port} -proxyPort 1090 - IP=`get-instance-ip.sh ${app}-mock` - - source ${SCRIPTS}/common_functions.sh - bypass_ip_adress ${IP} - - # Wait for initialization - for i in {1..10}; do - curl -sS ${IP}:${port} && break - echo sleep $i - sleep $i - done - - set -x - ${WORKSPACE}/scripts/dmaap-buscontroller/init-mock-${app}.sh ${IP} - set +x - - # this is the output of this function - #echo "$IP" -} - diff --git a/scripts/dmaap-datarouter/datarouter-launch.sh b/scripts/dmaap-datarouter/datarouter-launch.sh index 0339e389..6d38913d 100644 --- a/scripts/dmaap-datarouter/datarouter-launch.sh +++ b/scripts/dmaap-datarouter/datarouter-launch.sh @@ -23,15 +23,14 @@ function dmaap_dr_launch() { subscribers_required=$1 mkdir -p ${WORKSPACE}/archives/dmaap/dr/last_run_logs - cd ${WORKSPACE}/scripts/dmaap-datarouter/docker-compose # start DMaaP DR containers with docker compose and configuration from docker-compose.yml docker login -u docker -p docker nexus3.onap.org:10001 if [[ ${subscribers_required} == true ]]; then - docker-compose up -d + docker-compose -f ${WORKSPACE}/scripts/dmaap-datarouter/docker-compose/docker-compose.yml up -d else - docker-compose up -d datarouter-prov datarouter-node mariadb - fi + docker-compose -f ${WORKSPACE}/scripts/dmaap-datarouter/docker-compose/docker-compose.yml up -d datarouter-prov datarouter-node mariadb + fi # Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb for i in 1 2 3 4 5 6 7 8 9 10; do @@ -74,17 +73,18 @@ function dmaap_dr_launch() { echo DR_NODE_IP=${DR_NODE_IP} echo DR_GATEWAY_IP=${DR_GATEWAY_IP} if [[ ${subscribers_required} == true ]] - then - DR_SUB_IP=`get-instance-ip.sh subscriber-node` + then + DR_SUB_IP=`get-instance-ip.sh subscriber-node` DR_SUB2_IP=`get-instance-ip.sh subscriber-node2` echo DR_SUB_IP=${DR_SUB_IP} echo DR_SUB2_IP=${DR_SUB2_IP} - fi + fi sudo sed -i "$ a $DR_PROV_IP dmaap-dr-prov" /etc/hosts sudo sed -i "$ a $DR_NODE_IP dmaap-dr-node" /etc/hosts + docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$DR_GATEWAY_IP" docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$DR_GATEWAY_IP" #Pass any variables required by Robot test suites in ROBOT_VARIABLES diff --git a/scripts/dmaap-datarouter/datarouter-teardown.sh b/scripts/dmaap-datarouter/datarouter-teardown.sh new file mode 100755 index 00000000..8958f28c --- /dev/null +++ b/scripts/dmaap-datarouter/datarouter-teardown.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# ============LICENSE_START=================================================== +# Copyright (C) 2019-2021 Nordix Foundation. +# ============================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END===================================================== + +function teardown_dmaap_dr (){ + cd ${WORKSPACE}/archives/dmaap/dr + rm -rf last_run_logs/* + docker cp datarouter-prov:/opt/app/datartr/logs last_run_logs/prov_logs + docker cp datarouter-node:/opt/app/datartr/logs last_run_logs/node_event_logs + docker cp datarouter-node:/var/log/onap/datarouter last_run_logs/node_server_logs + docker cp subscriber-node:/var/log/onap/datarouter last_run_logs/sub1_logs + docker cp subscriber-node2:/var/log/onap/datarouter last_run_logs/sub2_logs + sudo sed -i".bak" '/dmaap-dr-prov/d' /etc/hosts + sudo sed -i".bak" '/dmaap-dr-node/d' /etc/hosts + docker-compose -f ${WORKSPACE}/scripts/dmaap-datarouter/docker-compose/docker-compose.yml rm -sf + cd ${WORKSPACE}/scripts/dmaap-datarouter/robot_ssl + python -c 'import update_ca; update_ca.remove_onap_ca_cert()' +}
\ No newline at end of file diff --git a/scripts/dmaap-datarouter/docker-compose/docker-compose.yml b/scripts/dmaap-datarouter/docker-compose/docker-compose.yml index 377e5514..2a0b4190 100644 --- a/scripts/dmaap-datarouter/docker-compose/docker-compose.yml +++ b/scripts/dmaap-datarouter/docker-compose/docker-compose.yml @@ -42,7 +42,7 @@ services: timeout: 30s retries: 5 networks: - testing_net: + net: aliases: - dmaap-dr-prov @@ -62,7 +62,7 @@ services: datarouter-prov: condition: service_healthy networks: - testing_net: + net: aliases: - dmaap-dr-node @@ -75,7 +75,7 @@ services: volumes: - ./subscriber.properties:/opt/app/subscriber/etc/subscriber.properties networks: - testing_net: + net: aliases: - subscriber.com @@ -88,7 +88,7 @@ services: volumes: - ./subscriber.properties:/opt/app/subscriber/etc/subscriber.properties networks: - testing_net: + net: aliases: - subscriber2.com @@ -109,10 +109,10 @@ services: timeout: 30s retries: 5 networks: - testing_net: + net: aliases: - datarouter-mariadb networks: - testing_net: + net: driver: bridge diff --git a/scripts/dmaap-message-router/dmaap-mr-launch.sh b/scripts/dmaap-message-router/dmaap-mr-launch.sh index 4fef6821..ccbe368c 100755 --- a/scripts/dmaap-message-router/dmaap-mr-launch.sh +++ b/scripts/dmaap-message-router/dmaap-mr-launch.sh @@ -31,101 +31,101 @@ source ${SCRIPTS}/common_functions.sh # (kafka and zk containers are not called externally) function dmaap_mr_launch() { - # - # the default prefix for docker containers is the directory name containing the docker-compose.yml file. - # It can be over-written by an env variable COMPOSE_PROJECT_NAME. This env var seems to be set in the Jenkins CSIT environment - COMPOSE_PREFIX=${COMPOSE_PROJECT_NAME:-dockercompose} - export COMPOSE_PROJECT_NAME=$COMPOSE_PREFIX - echo "COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME" - echo "COMPOSE_PREFIX=$COMPOSE_PREFIX" - - # Clone DMaaP Message Router repo - mkdir -p $WORKSPACE/archives/dmaapmr - cd $WORKSPACE/archives/dmaapmr - #unset http_proxy https_proxy - git clone --depth 1 http://gerrit.onap.org/r/dmaap/messagerouter/messageservice -b master - cd messageservice - git pull - cd $WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose - cp $WORKSPACE/archives/dmaapmr/messageservice/bundleconfig-local/etc/appprops/MsgRtrApi.properties /var/tmp/ - - - # start DMaaP MR containers with docker compose and configuration from docker-compose.yml - docker login -u docker -p docker nexus3.onap.org:10001 - docker-compose up -d - docker ps - - # Wait for initialization of Docker contaienr for DMaaP MR, Kafka and Zookeeper - for i in {1..50}; do - if [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_zookeeper_1) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] - then - echo "DMaaP Service Running" - break - else - echo sleep $i - sleep $i - fi - done - - - DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_dmaap_1) - IP=${DMAAP_MR_IP} - KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_kafka_1) - ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_zookeeper_1) - - echo DMAAP_MR_IP=${DMAAP_MR_IP} - echo IP=${IP} - echo KAFKA_IP=${KAFKA_IP} - echo ZOOKEEPER_IP=${ZOOKEEPER_IP} - - # Initial docker-compose up and down is for populating kafka and zookeeper IPs in /var/tmp/MsgRtrApi.properites - docker-compose down - - # Update kafkfa and zookeeper properties in MsgRtrApi.propeties which will be copied to DMaaP Container - sed -i -e 's/<zookeeper_host>/zookeeper/' /var/tmp/MsgRtrApi.properties - sed -i -e 's/<kafka_host>:<kafka_port>/kafka:9092/' /var/tmp/MsgRtrApi.properties - - docker-compose build - docker login -u docker -p docker nexus3.onap.org:10001 - docker-compose up -d - docker ps - - # Wait for initialization of Docker containers - for i in {1..50}; do - if [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_zookeeper_1) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] - then - echo "DMaaP Service Running" - break - else - echo sleep $i - sleep $i - fi - done - DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_dmaap_1) - IP=${DMAAP_MR_IP} - KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_kafka_1) - ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_zookeeper_1) - - echo "After restart of ZK and Kafka..." - echo DMAAP_MR_IP=${DMAAP_MR_IP} - echo IP=${IP} - echo KAFKA_IP=${KAFKA_IP} - echo ZOOKEEPER_IP=${ZOOKEEPER_IP} + # + # the default prefix for docker containers is the directory name containing the docker-compose.yml file. + # It can be over-written by an env variable COMPOSE_PROJECT_NAME. This env var seems to be set in the Jenkins CSIT environment + COMPOSE_PREFIX=${COMPOSE_PROJECT_NAME:-dockercompose} + export COMPOSE_PROJECT_NAME=$COMPOSE_PREFIX + echo "COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME" + echo "COMPOSE_PREFIX=$COMPOSE_PREFIX" + + # Clone DMaaP Message Router repo + mkdir -p $WORKSPACE/archives/dmaapmr + cd $WORKSPACE/archives/dmaapmr + #unset http_proxy https_proxy + git clone --depth 1 http://gerrit.onap.org/r/dmaap/messagerouter/messageservice -b master + cd messageservice + git pull + cd $WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose + cp $WORKSPACE/archives/dmaapmr/messageservice/bundleconfig-local/etc/appprops/MsgRtrApi.properties /var/tmp/ + + + # start DMaaP MR containers with docker compose and configuration from docker-compose.yml + docker login -u docker -p docker nexus3.onap.org:10001 + docker-compose up -d + docker ps + + # Wait for initialization of Docker contaienr for DMaaP MR, Kafka and Zookeeper + for i in {1..50}; do + if [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_zookeeper_1) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] + then + echo "DMaaP Service Running" + break + else + echo sleep $i + sleep $i + fi + done + + + DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_dmaap_1) + IP=${DMAAP_MR_IP} + KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_kafka_1) + ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_zookeeper_1) + + echo DMAAP_MR_IP=${DMAAP_MR_IP} + echo IP=${IP} + echo KAFKA_IP=${KAFKA_IP} + echo ZOOKEEPER_IP=${ZOOKEEPER_IP} + + # Initial docker-compose up and down is for populating kafka and zookeeper IPs in /var/tmp/MsgRtrApi.properites + docker-compose down + + # Update kafkfa and zookeeper properties in MsgRtrApi.propeties which will be copied to DMaaP Container + sed -i -e 's/<zookeeper_host>/zookeeper/' /var/tmp/MsgRtrApi.properties + sed -i -e 's/<kafka_host>:<kafka_port>/kafka:9092/' /var/tmp/MsgRtrApi.properties + + docker-compose build + docker login -u docker -p docker nexus3.onap.org:10001 + docker-compose up -d + docker ps + + # Wait for initialization of Docker containers + for i in {1..50}; do + if [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_zookeeper_1) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] + then + echo "DMaaP Service Running" + break + else + echo sleep $i + sleep $i + fi + done + DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_dmaap_1) + IP=${DMAAP_MR_IP} + KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_kafka_1) + ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_zookeeper_1) + + echo "After restart of ZK and Kafka..." + echo DMAAP_MR_IP=${DMAAP_MR_IP} + echo IP=${IP} + echo KAFKA_IP=${KAFKA_IP} + echo ZOOKEEPER_IP=${ZOOKEEPER_IP} source ${SCRIPTS}/common_functions.sh bypass_ip_adress ${DMAAP_MR_IP} bypass_ip_adress ${KAFKA_IP} bypass_ip_adress ${ZOOKEEPER_IP} - # Wait for initialization of docker services - for i in {1..50}; do - curl -sS -m 1 ${DMAAP_MR_IP}:3904/events/TestTopic && break - echo sleep $i - sleep $i - done + # Wait for initialization of docker services + for i in {1..50}; do + curl -sS -m 1 ${DMAAP_MR_IP}:3904/events/TestTopic && break + echo sleep $i + sleep $i + done } diff --git a/tests/dmaap-buscontroller/single-mr-suite/__init__.robot b/tests/dmaap-buscontroller/single-mr-suite/__init__.robot deleted file mode 100644 index 41c7a003..00000000 --- a/tests/dmaap-buscontroller/single-mr-suite/__init__.robot +++ /dev/null @@ -1,3 +0,0 @@ -*** Settings *** -Documentation dmaap-buscontroller - Suite 1 - diff --git a/tests/dmaap-buscontroller/ssl_suite/__init__.robot b/tests/dmaap-buscontroller/ssl_suite/__init__.robot deleted file mode 100644 index 41c7a003..00000000 --- a/tests/dmaap-buscontroller/ssl_suite/__init__.robot +++ /dev/null @@ -1,3 +0,0 @@ -*** Settings *** -Documentation dmaap-buscontroller - Suite 1 - diff --git a/tests/dmaap-buscontroller/ssl_suite/test1.robot b/tests/dmaap-buscontroller/ssl_suite/test1.robot deleted file mode 100644 index b5723377..00000000 --- a/tests/dmaap-buscontroller/ssl_suite/test1.robot +++ /dev/null @@ -1,77 +0,0 @@ -*** Settings *** -Library OperatingSystem -Library RequestsLibrary -Library HttpLibrary.HTTP -Library Collections -Library String - -*** Variables *** -${MESSAGE} Hello, world! -${DBC_URI} /webapi - -*** Test Cases *** -String Equality Test - Should Be Equal ${MESSAGE} Hello, world! - -Dir Test - [Documentation] Check if /tmp exists - Log ${MESSAGE} - CheckDir /tmp - -Url Test - [Documentation] Check if www.onap.org can be reached - Create Session openo http://www.onap.org disable_warnings=True - CheckUrl openo / 200 - -HTTPS Heartbeat Test - [Documentation] Check ${DBC_URI}/info SSL endpoint - Create Session heartbeat https://${DMAAPBC_IP}:8443 disable_warnings=True - CheckUrl heartbeat ${DBC_URI}/info 204 - -HTTPS Dmaap Init Test - [Documentation] Check ${DBC_URI}/dmaap SSL endpoint - Create Session heartbeat https://${DMAAPBC_IP}:8443 disable_warnings=True - CheckStatus heartbeat ${DBC_URI}/dmaap "VALID" - -HTTPS Dmaap dcaeLocations Test - [Documentation] Check ${DBC_URI}/dcaeLocations SSL endpoint - Create Session heartbeat https://${DMAAPBC_IP}:8443 disable_warnings=True - CheckStatus0 heartbeat ${DBC_URI}/dcaeLocations "VALID" - -HTTPS Dmaap mr_clusters Test - [Documentation] Check ${DBC_URI}/mr_clusters SSL endpoint - Create Session heartbeat https://${DMAAPBC_IP}:8443 disable_warnings=True - CheckStatus0 heartbeat ${DBC_URI}/mr_clusters "VALID" - - -*** Keywords *** -CheckDir - [Arguments] ${path} - Directory Should Exist ${path} - -CheckUrl - [Arguments] ${session} ${path} ${expect} - ${resp}= RequestsLibrary.Get On Session ${session} ${path} - Should Be Equal As Integers ${resp.status_code} ${expect} - -CheckStatus - [Arguments] ${session} ${path} ${expect} - ${resp}= RequestsLibrary.Get On Session ${session} ${path} - log ${resp.content} - ${val}= Get Json value ${resp.content} /status - log ${val} - should be equal as strings ${val} ${expect} - -CheckStatus0 - [Arguments] ${session} ${path} ${expect} - ${resp}= RequestsLibrary.Get On Session ${session} ${path} - log ${resp.json()} - log ${resp.content} -# silliness to strip off the brackets returned for a List to get a Dict - ${t1}= Remove String ${resp.content} [ - ${dict}= Remove String ${t1} ] - log ${dict} - ${val}= Get Json value ${dict} /status - log ${val} - should be equal as strings ${val} ${expect} - diff --git a/tests/dmaap-buscontroller/suite1/__init__.robot b/tests/dmaap-buscontroller/suite1/__init__.robot deleted file mode 100644 index 41c7a003..00000000 --- a/tests/dmaap-buscontroller/suite1/__init__.robot +++ /dev/null @@ -1,3 +0,0 @@ -*** Settings *** -Documentation dmaap-buscontroller - Suite 1 - diff --git a/tests/dmaap-buscontroller/suite1/test1.robot b/tests/dmaap-buscontroller/suite1/test1.robot deleted file mode 100644 index be4e8cc6..00000000 --- a/tests/dmaap-buscontroller/suite1/test1.robot +++ /dev/null @@ -1,42 +0,0 @@ -*** Settings *** -Library OperatingSystem -Library RequestsLibrary - -*** Variables *** -${MESSAGE} Hello, world! -${DBC_URI} /webapi - -*** Test Cases *** -String Equality Test - Should Be Equal ${MESSAGE} Hello, world! - -Dir Test - [Documentation] Check if /tmp exists - Log ${MESSAGE} - CheckDir /tmp - -Url Test - [Documentation] Check if www.onap.org can be reached - Create Session openo http://www.onap.org - CheckUrl openo / 200 - -Mock Hello Server Test - [Documentation] Check /hello endpoint - Create Session hello http://${AAF_IP}:1080 - CheckUrl hello /hello 200 - -Heartbeat Test - [Documentation] Check ${DBC_URI}/info endpoint - Create Session heartbeat http://${DMAAPBC_IP}:8080 - CheckUrl heartbeat ${DBC_URI}/info 204 - -*** Keywords *** -CheckDir - [Arguments] ${path} - Directory Should Exist ${path} - -CheckUrl - [Arguments] ${session} ${path} ${expect} - ${resp}= Get Request ${session} ${path} - Should Be Equal As Integers ${resp.status_code} ${expect} - diff --git a/tests/dmaap-buscontroller/with_dr/__init__.robot b/tests/dmaap-buscontroller/with_dr/__init__.robot new file mode 100644 index 00000000..2d404124 --- /dev/null +++ b/tests/dmaap-buscontroller/with_dr/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation dmaap-buscontroller - dr diff --git a/tests/dmaap-buscontroller/with_dr/orig b/tests/dmaap-buscontroller/with_dr/orig deleted file mode 100755 index fcac2026..00000000 --- a/tests/dmaap-buscontroller/with_dr/orig +++ /dev/null @@ -1,116 +0,0 @@ -*** Settings *** -Library OperatingSystem -Library RequestsLibrary -Library requests -Library Collections -Library String - -*** Variables *** -${TARGET_URL} https://${DR_PROV_IP}:8443 -${TARGET_URL_FEED} https://${DR_PROV_IP}:8443/feed/1 -${TARGET_URL_SUBSCRIBE} https://${DR_PROV_IP}:8443/subscribe/1 -${TARGET_URL_SUBSCRIPTION} https://${DR_PROV_IP}:8443/subs/1 -${TARGET_URL_PUBLISH} https://${DR_NODE_IP}:8443/publish/1/csit_test -${CREATE_FEED_DATA} {"name": "CSIT_Test", "version": "m1.0", "description": "CSIT_Test", "business_description": "CSIT_Test", "suspend": false, "deleted": false, "changeowner": true, "authorization": {"classification": "unclassified", "endpoint_addrs": [], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}} -${UPDATE_FEED_DATA} {"name": "CSIT_Test", "version": "m1.0", "description": "UPDATED-CSIT_Test", "business_description": "CSIT_Test", "suspend": true, "deleted": false, "changeowner": true, "authorization": {"classification": "unclassified", "endpoint_addrs": [], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}} -${SUBSCRIBE_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"rs873m", "password":"rs873m", "use100":true}, "metadataOnly":false, "suspend":false, "groupid":29, "subscriber":"sg481n"} -${UPDATE_SUBSCRIPTION_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"sg481n", "password":"sg481n", "use100":true}, "metadataOnly":false, "suspend":true, "groupid":29, "subscriber":"sg481n"} -${FEED_CONTENT_TYPE} application/vnd.att-dr.feed -${SUBSCRIBE_CONTENT_TYPE} application/vnd.att-dr.subscription -${PUBLISH_FEED_CONTENT_TYPE} application/octet-stream - -*** Test Cases *** -Run Feed Creation - [Documentation] Feed Creation - [Timeout] 1 minute - ${resp}= PostCall ${TARGET_URL} ${CREATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m - log ${TARGET_URL} - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 201 - log 'JSON Response Code:'${resp} - -Run Subscribe to Feed - [Documentation] Subscribe to Feed - [Timeout] 1 minute - ${resp}= PostCall ${TARGET_URL_SUBSCRIBE} ${SUBSCRIBE_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n - log ${TARGET_URL_SUBSCRIBE} - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 201 - log 'JSON Response Code:'${resp} - -Run Publish Feed - [Documentation] Publish to Feed - [Timeout] 1 minute - Sleep 10s Behaviour was noticed where feed was not created in time for publish to be sent - ${resp}= PutCall ${TARGET_URL_PUBLISH} ${CREATE_FEED_DATA} ${PUBLISH_FEED_CONTENT_TYPE} rs873m - log ${TARGET_URL_PUBLISH} - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 204 - log 'JSON Response Code:'${resp} - -Run Update Subscription - [Documentation] Update Subscription to suspend and change delivery credentials - [Timeout] 1 minute - ${resp}= PutCall ${TARGET_URL_SUBSCRIPTION} ${UPDATE_SUBSCRIPTION_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n - log ${TARGET_URL_SUBSCRIPTION} - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - log 'JSON Response Code:'${resp} - ${resp}= GetCall ${TARGET_URL_SUBSCRIPTION} ${SUBSCRIBE_CONTENT_TYPE} sg481n - log ${resp.text} - Should Contain ${resp.text} "password":"sg481n","user":"sg481n" - log 'JSON Response Code:'${resp} - -Run Update Feed - [Documentation] Update Feed description and suspend - [Timeout] 1 minute - ${resp}= PutCall ${TARGET_URL_FEED} ${UPDATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m - log ${TARGET_URL_FEED} - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - log 'JSON Response Code:'${resp} - ${resp}= GetCall ${TARGET_URL_FEED} ${FEED_CONTENT_TYPE} rs873m - log ${resp.text} - Should Contain ${resp.text} "UPDATED-CSIT_Test" - log 'JSON Response Code:'${resp} - -Run Delete Subscription - [Documentation] Delete Subscription - [Timeout] 1 minute - ${resp}= DeleteCall ${TARGET_URL_SUBSCRIPTION} sg481n - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 204 - log 'JSON Response Code:'${resp} - -Run Delete Feed - [Documentation] Delete Feed - [Timeout] 1 minute - ${resp}= DeleteCall ${TARGET_URL_FEED} rs873m - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 204 - log 'JSON Response Code:'${resp} - -*** Keywords *** -PostCall - [Arguments] ${url} ${data} ${content_type} ${user} - ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} - ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests - [Return] ${resp} - -PutCall - [Arguments] ${url} ${data} ${content_type} ${user} - ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} Authorization=Basic cnM4NzNtOnJzODczbQ== - ${resp}= Evaluate requests.put('${url}',data='${data}', headers=${headers},verify=False) requests - [Return] ${resp} - -GetCall - [Arguments] ${url} ${content_type} ${user} - ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} - ${resp}= Evaluate requests.get('${url}', headers=${headers},verify=False) requests - [Return] ${resp} - -DeleteCall - [Arguments] ${url} ${user} - ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} - ${resp}= Evaluate requests.delete('${url}', headers=${headers},verify=False) requests - [Return] ${resp} diff --git a/tests/dmaap-buscontroller/with_dr/test1.robot b/tests/dmaap-buscontroller/with_dr/test1.robot index a3aef42b..671e89b7 100644 --- a/tests/dmaap-buscontroller/with_dr/test1.robot +++ b/tests/dmaap-buscontroller/with_dr/test1.robot @@ -9,127 +9,60 @@ Library String *** Variables *** -${MESSAGE} Hello, world! -${DBC_URI} webapi -${DBC_URL} http://${DMAAPBC_IP}:8080/${DBC_URI} +${DBC_URI} webapi +${DBC_URL} http://${DMAAPBC_IP}:8080/${DBC_URI} ${LOC} csit-sanfrancisco -${PUB_CORE} "dcaeLocationName": "${LOC}", "clientRole": "org.onap.dmaap.client.pub", "action": [ "pub", "view" ] -${SUB_CORE} "dcaeLocationName": "${LOC}", "clientRole": "org.onap.dmaap.client.sub", "action": [ "sub", "view" ] -${PUB} { ${PUB_CORE} } -${SUB} { ${SUB_CORE} } ${FEED1_DATA} { "feedName":"feed1", "feedVersion": "csit", "feedDescription":"generated for CSIT", "owner":"dgl", "asprClassification": "unclassified" } ${FEED2_DATA} { "feedName":"feed2", "feedVersion": "csit", "feedDescription":"generated for CSIT", "owner":"dgl", "asprClassification": "unclassified" } ${PUB2_DATA} { "dcaeLocationName": "${LOC}", "username": "pub2", "userpwd": "topSecret123", "feedId": "2" } ${SUB2_DATA} { "dcaeLocationName": "${LOC}", "username": "sub2", "userpwd": "someSecret123", "deliveryURL": "https://${DMAAPBC_IP}:8443/webapi/noURI", "feedId": "2" } -${TOPIC2_DATA} { "topicName":"singleMRtopic2", "topicDescription":"generated for CSIT", "owner":"dgl", "clients": [ ${PUB}, ${SUB}] } -${TOPIC3_DATA} { "topicName":"singleMRtopic3", "topicDescription":"generated for CSIT", "owner":"dgl"} -#${PUB3_DATA} { "fqtn": "${TOPIC_NS}.singleMRtopic3", ${PUB_CORE} } -#${SUB3_DATA} { "fqtn": "${TOPIC_NS}.singleMRtopic3", ${SUB_CORE} } - *** Test Cases *** -Url Test - [Documentation] Check if www.onap.org can be reached - Create Session sanity http://onap.readthedocs.io - ${resp}= Get Request sanity / - Should Be Equal As Integers ${resp.status_code} 200 - (DMAAP-441c1) [Documentation] Create Feed w no clients POST ${DBC_URI}/feeds endpoint - ${resp}= PostCall ${DBC_URL}/feeds ${FEED1_DATA} - Should Be Equal As Integers ${resp.status_code} 200 + ${resp}= PostCall ${DBC_URL}/feeds ${FEED1_DATA} + Should Be Equal As Integers ${resp.status_code} 200 (DMAAP-441c2) [Documentation] Create Feed w clients POST ${DBC_URI}/feeds endpoint - ${resp}= PostCall ${DBC_URL}/feeds ${FEED2_DATA} - Should Be Equal As Integers ${resp.status_code} 200 + ${resp}= PostCall ${DBC_URL}/feeds ${FEED2_DATA} + Should Be Equal As Integers ${resp.status_code} 200 (DMAAP-441c3) [Documentation] Add Publisher to existing feed - ${resp}= PostCall ${DBC_URL}/dr_pubs ${PUB2_DATA} - Should Be Equal As Integers ${resp.status_code} 201 - ${tmp}= Get Json Value ${resp.text} /pubId - ${tmp}= Remove String ${tmp} \" - Set Suite Variable ${pubId} ${tmp} + ${resp}= PostCall ${DBC_URL}/dr_pubs ${PUB2_DATA} + Should Be Equal As Integers ${resp.status_code} 201 + ${JSON}= Evaluate json.loads(r"""${resp.content}""", strict=False) + ${result}= Set Variable ${JSON['pubId']} + Set Suite Variable ${pubId} ${result} (DMAAP-441c4) [Documentation] Add Subscriber to existing feed - ${resp}= PostCall ${DBC_URL}/dr_subs ${SUB2_DATA} - Should Be Equal As Integers ${resp.status_code} 201 - ${tmp}= Get Json Value ${resp.text} /subId - ${tmp}= Remove String ${tmp} \" - Set Suite Variable ${subId} ${tmp} + ${resp}= PostCall ${DBC_URL}/dr_subs ${SUB2_DATA} + Should Be Equal As Integers ${resp.status_code} 201 + ${JSON}= Evaluate json.loads(r"""${resp.content}""", strict=False) + ${result}= Set Variable ${JSON['subId']} + Set Suite Variable ${subId} ${result} (DMAAP-443) [Documentation] List existing feeds Create Session get ${DBC_URL} - ${resp}= Get Request get /feeds - Should Be Equal As Integers ${resp.status_code} 200 + ${resp}= GET On Session get /feeds + Should Be Equal As Integers ${resp.status_code} 200 (DMAAP-444) [Documentation] Delete existing subscriber - ${resp}= DelCall ${DBC_URL}/dr_subs/${subId} - Should Be Equal As Integers ${resp.status_code} 204 + ${resp}= DelCall ${DBC_URL}/dr_subs/${subId} + Should Be Equal As Integers ${resp.status_code} 204 (DMAAP-445) [Documentation] Delete existing publisher - ${resp}= DelCall ${DBC_URL}/dr_pubs/${pubId} - Should Be Equal As Integers ${resp.status_code} 204 - -#(DMAAP-294) -# [Documentation] Create Topic w pub and sub clients POST ${DBC_URI}/topics endpoint -# ${resp}= PostCall ${DBC_URL}/topics ${TOPIC2_DATA} -# Should Be Equal As Integers ${resp.status_code} 201 -# -#(DMAAP-295) -# [Documentation] Create Topic w no clients and then add a client POST ${DBC_URI}/mr_clients endpoint -# ${resp}= PostCall ${DBC_URL}/topics ${TOPIC3_DATA} -# Should Be Equal As Integers ${resp.status_code} 201 -# ${resp}= PostCall ${DBC_URL}/mr_clients ${PUB3_DATA} -# Should Be Equal As Integers ${resp.status_code} 200 -# ${resp}= PostCall ${DBC_URL}/mr_clients ${SUB3_DATA} -# Should Be Equal As Integers ${resp.status_code} 200 -# -#(DMAAP-297) -# [Documentation] Query for all topics and specific topic -# Create Session get ${DBC_URL} -# ${resp}= Get Request get /topics -# Should Be Equal As Integers ${resp.status_code} 200 -# ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 -# Should Be Equal As Integers ${resp.status_code} 200 -# -#(DMAAP-301) -# [Documentation] Delete a subscriber -# Create Session get ${DBC_URL} -# ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 -# Should Be Equal As Integers ${resp.status_code} 200 -# ${tmp}= Get Json Value ${resp.text} /clients/1/mrClientId -# ${clientId}= Remove String ${tmp} \" -# ${resp}= DelCall ${DBC_URL}/mr_clients/${clientId} -# Should Be Equal As Integers ${resp.status_code} 204 -# -#(DMAAP-302) -# [Documentation] Delete a publisher -# Create Session get ${DBC_URL} -# ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 -# Should Be Equal As Integers ${resp.status_code} 200 -# ${tmp}= Get Json Value ${resp.text} /clients/0/mrClientId -# ${clientId}= Remove String ${tmp} \" -# ${resp}= DelCall ${DBC_URL}/mr_clients/${clientId} -# Should Be Equal As Integers ${resp.status_code} 204 + ${resp}= DelCall ${DBC_URL}/dr_pubs/${pubId} + Should Be Equal As Integers ${resp.status_code} 204 *** Keywords *** -CheckDir - [Arguments] ${path} - Directory Should Exist ${path} - -CheckUrl - [Arguments] ${session} ${path} ${expect} - ${resp}= Get Request ${session} ${path} - Should Be Equal As Integers ${resp.status_code} ${expect} - PostCall [Arguments] ${url} ${data} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json diff --git a/tests/dmaap-buscontroller/with_mr/__init__.robot b/tests/dmaap-buscontroller/with_mr/__init__.robot new file mode 100644 index 00000000..ffcec41b --- /dev/null +++ b/tests/dmaap-buscontroller/with_mr/__init__.robot @@ -0,0 +1,3 @@ +*** Settings *** +Documentation dmaap-buscontroller - mr + diff --git a/tests/dmaap-buscontroller/single-mr-suite/test1.robot b/tests/dmaap-buscontroller/with_mr/test1.robot index d68b9ed1..37d3e158 100644 --- a/tests/dmaap-buscontroller/single-mr-suite/test1.robot +++ b/tests/dmaap-buscontroller/with_mr/test1.robot @@ -9,9 +9,8 @@ Library String *** Variables *** -${MESSAGE} Hello, world! -${DBC_URI} webapi -${DBC_URL} http://${DMAAPBC_IP}:8080/${DBC_URI} +${DBC_URI} webapi +${DBC_URL} http://${DMAAP_BC_IP}:8080/${DBC_URI} ${TOPIC_NS} org.onap.dmaap.onapCSIT ${LOC} csit-sanfrancisco ${PUB_CORE} "dcaeLocationName": "${LOC}", "clientRole": "org.onap.dmaap.client.pub", "action": [ "pub", "view" ] @@ -25,14 +24,7 @@ ${PUB3_DATA} { "fqtn": "${TOPIC_NS}.singleMRtopic3", ${PUB_CORE} } ${SUB3_DATA} { "fqtn": "${TOPIC_NS}.singleMRtopic3", ${SUB_CORE} } - *** Test Cases *** -Url Test - [Documentation] Check if www.onap.org can be reached - Create Session sanity http://onap.readthedocs.io - ${resp}= Get Request sanity / - Should Be Equal As Integers ${resp.status_code} 200 - (DMAAP-293) [Documentation] Create Topic w no clients POST ${DBC_URI}/topics endpoint ${resp}= PostCall ${DBC_URL}/topics ${TOPIC1_DATA} @@ -55,42 +47,33 @@ Url Test (DMAAP-297) [Documentation] Query for all topics and specific topic Create Session get ${DBC_URL} - ${resp}= Get Request get /topics + ${resp}= GET On Session get /topics Should Be Equal As Integers ${resp.status_code} 200 - ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 + ${resp}= GET On Session get /topics/${TOPIC_NS}.singleMRtopic3 Should Be Equal As Integers ${resp.status_code} 200 (DMAAP-301) [Documentation] Delete a subscriber Create Session get ${DBC_URL} - ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 + ${resp}= GET On Session get /topics/${TOPIC_NS}.singleMRtopic3 Should Be Equal As Integers ${resp.status_code} 200 - ${tmp}= Get Json Value ${resp.text} /clients/1/mrClientId - ${clientId}= Remove String ${tmp} \" + ${JSON}= Evaluate json.loads(r"""${resp.content}""", strict=False) + ${clientId}= Set Variable ${JSON['clients'][1]['mrClientId']} ${resp}= DelCall ${DBC_URL}/mr_clients/${clientId} Should Be Equal As Integers ${resp.status_code} 204 (DMAAP-302) [Documentation] Delete a publisher Create Session get ${DBC_URL} - ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 + ${resp}= GET On Session get /topics/${TOPIC_NS}.singleMRtopic3 Should Be Equal As Integers ${resp.status_code} 200 - ${tmp}= Get Json Value ${resp.text} /clients/0/mrClientId - ${clientId}= Remove String ${tmp} \" + ${JSON}= Evaluate json.loads(r"""${resp.content}""", strict=False) + ${clientId}= Set Variable ${JSON['clients'][0]['mrClientId']} ${resp}= DelCall ${DBC_URL}/mr_clients/${clientId} Should Be Equal As Integers ${resp.status_code} 204 *** Keywords *** -CheckDir - [Arguments] ${path} - Directory Should Exist ${path} - -CheckUrl - [Arguments] ${session} ${path} ${expect} - ${resp}= Get Request ${session} ${path} - Should Be Equal As Integers ${resp.status_code} ${expect} - PostCall [Arguments] ${url} ${data} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/BulkpmE2E.robot b/tests/usecases-5G-bulkpm/5G-bulkpm/BulkpmE2E.robot deleted file mode 100644 index 660c5f64..00000000 --- a/tests/usecases-5G-bulkpm/5G-bulkpm/BulkpmE2E.robot +++ /dev/null @@ -1,125 +0,0 @@ -*** Settings *** -Documentation Testing E2E VES,Dmaap,DFC,DR with File Ready event feed from xNF -Library RequestsLibrary -Library OperatingSystem -Library Collections -Library Process -Resource resources/bulkpm_keywords.robot -Library resources/JsonValidatorLibrary.py -Library resources/xNFLibrary.py - - -*** Variables *** -${VESC_URL} http://%{VESC_IP}:%{VESC_PORT} -${GLOBAL_APPLICATION_ID} robot-ves -${VES_ANY_EVENT_PATH} /eventListener/v7 -${HEADER_STRING} content-type=application/json -${EVENT_DATA_FILE} %{WORKSPACE}/tests/usecases-5G-bulkpm/5G-bulkpm/assets/json_events/FileExistNotification.json - -${TARGETURL_TOPICS} http://${DMAAP_MR_IP}:3904/topics -${TARGETURL_SUBSCR} http://${DMAAP_MR_IP}:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12?timeout=1000 -${CLI_EXEC_CLI} curl -k https://${DR_PROV_IP}:8443/internal/prov -${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 dcaegen2-datafile-collector /bin/sh -c "cat /var/log/ONAP/application.log" > %{WORKSPACE}/archives/dfc_docker.log -${CLI_EXEC_CLI_DFC_LOG_GREP} grep "Datafile file published" %{WORKSPACE}/archives/dfc_docker.log -${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}/archives/metadata.json -${CLI_EXEC_CLI_PMMAPPER_LOG} docker exec dcaegen2-pm-mapper /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" > %{WORKSPACE}/archives/pmmapper_docker.log -${CLI_EXEC_CLI_PMMAPPER_LOG_GREP} grep "XML validation successful" %{WORKSPACE}/archives/pmmapper_docker.log -${CLI_EXEC_CLI_PMMAPPER_LOG_GREP_VES} grep "Successfully published VES events to messagerouter" %{WORKSPACE}/archives/pmmapper_docker.log -${metadataSchemaPath} %{WORKSPACE}/tests/usecases-5G-bulkpm/5G-bulkpm/assets/metadata.schema.json -${metadataJsonPath} %{WORKSPACE}/archives/metadata.json - -*** Test Cases *** - -Send VES File Ready Event to VES Collector - [Tags] Bulk_PM_E2E_01 - [Documentation] Send VES File Ready Event - ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE} - ${headers}= Create Header From String ${HEADER_STRING} - ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} - Sleep 15s - ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} - Sleep 5s - ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} - Sleep 5s - ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} - Sleep 5s - Log Receive HTTP Status code ${resp.status_code} - Should Be Equal As Strings ${resp.status_code} 202 - -Check VES Notification Topic is existing in Message Router - [Tags] Bulk_PM_E2E_02 - [Documentation] Get the VES Notification topic on message router - [Timeout] 1 minute - Sleep 10s - ${resp}= GetCall ${TARGETURL_TOPICS} - log ${TARGETURL_TOPICS} - log 'JSON Response Code :'${resp} - ${topics}= Evaluate $resp.json().get('topics') - log ${topics} - ${ListLength}= Get Length ${topics} - log ${ListLength} - List Should Contain Value ${topics} unauthenticated.VES_NOTIFICATION_OUTPUT - -Verify Data File Collector successfully publishes the PM XML file to the Data Router - [Tags] Bulk_PM_E2E_03 - [Documentation] Check that DFC publishes the PM XML to the Data Router - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_DFC_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_DFC_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} Datafile file published - - -Verify Default Feed And File Consumer Subscription On Datarouter - [Tags] Bulk_PM_E2E_04 - [Documentation] Verify Default Feed And File Consumer Subscription On Datarouter - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} https://dmaap-dr-prov/publish/1 - Should Contain ${cli_cmd_output.stdout} http://datarouter-subscriber:7070 - - -Verify Fileconsumer Receive PM file from Data Router - [Tags] Bulk_PM_E2E_05 - [Documentation] Check PM XML file exists on the File Consumer Simulator - ${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} A20181002.0000-1000-0015-1000_5G.xml - -Verify File Consumer Receive valid metadata from Data Router - [Tags] Bulk_PM_E2E_06 - [Documentation] Check PM XML file is delivered to the FileConsumer Simulator with valid metadata - ${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} 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 - -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 - -Verify PM-Mapper successfully publishes VES event the Message Router - [Tags] Bulk_PM_E2E_08 - [Documentation] Check that PM-Mapper publishes VES onto the Message Router - ${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_VES} shell=yes - Should Contain ${cli_cmd_output.stdout} Successfully published VES events to messagerouter
\ No newline at end of file diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/__init__.robot b/tests/usecases-5G-bulkpm/5G-bulkpm/__init__.robot deleted file mode 100644 index 7114fd44..00000000 --- a/tests/usecases-5G-bulkpm/5G-bulkpm/__init__.robot +++ /dev/null @@ -1,2 +0,0 @@ -*** Settings *** -Documentation 5G Bulk PM E2E Testcases diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/assets/json_events/FileExistNotification.json b/tests/usecases-5G-bulkpm/5G-bulkpm/assets/json_events/FileExistNotification.json deleted file mode 100644 index 02f092df..00000000 --- a/tests/usecases-5G-bulkpm/5G-bulkpm/assets/json_events/FileExistNotification.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "event": { - "commonEventHeader": { - "version": "4.0.1", - "vesEventListenerVersion": "7.0.1", - "domain": "notification", - "eventName": "Noti_RnNode-Ericsson_FileReady", - "eventId": "FileReady_1797490e-10ae-4d48-9ea7-3d7d790b25e1", - "lastEpochMicrosec": 8745745764578, - "priority": "Normal", - "reportingEntityName": "otenb5309", - "sequence": 0, - "sourceName": "oteNB5309", - "startEpochMicrosec": 8745745764578, - "timeZoneOffset": "UTC+05.30" - }, - "notificationFields": { - "changeIdentifier": "PM_MEAS_FILES", - "changeType": "FileReady", - "notificationFieldsVersion": "2.0", - "arrayOfNamedHashMap": [ - { "name": "A20181002.0000-1000-0015-1000_5G.xml.gz", - "hashMap":{ - "location": "sftp://admin:admin@sftp:22/A20181002.0000-1000-0015-1000_5G.xml.gz", - "compression": "gzip", - "fileFormatType": "org.3GPP.32.435#measCollec", - "fileFormatVersion": "V10" - } - } - ] - } -} -}
\ No newline at end of file diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/assets/metadata.schema.json b/tests/usecases-5G-bulkpm/5G-bulkpm/assets/metadata.schema.json deleted file mode 100644 index a41b3544..00000000 --- a/tests/usecases-5G-bulkpm/5G-bulkpm/assets/metadata.schema.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "$id": "metadata.schema.json", - "title": "DataRouter PM File Metadata", - "description": "Metadata for 3GPP PM files that are placed on the DMaaP Data Router by the Data File Collector (VES 7.1)", - "type": "object", - - "properties": { - "productName": { - "description": "from the FileReady event eventName", - "type": "string" - }, - - "vendorName": { - "description": "from the FileReady event eventName", - "type": "string" - }, - - "lastEpochMicrosec": { - "description": "the latest unix epoch time associated with the FileReady event", - "type": "string" - }, - - "sourceName": { - "description": "the name of the entity experiencing the event", - "type": "string" - }, - - "startEpochMicrosec": { - "description": "the earliest unix epoch time associated with the FileReady event", - "type": "string" - }, - - "timeZoneOffset": { - "description": "the timezone offset from UTC", - "type": "string", - "pattern": "^(?:(?:[a-zA-Z]{3})[+-](?:[01][0-9]|2[0-3]).[0-5][0-9])$" - }, - - "location": { - "description": "follows the format <protocol>://<ip address>:<port>/<path>/<filename>, the IP address is the node ip address, the port of the protocol server", - "type": "string" - }, - - "compression": { - "description": "specifies if the file is compressed", - "type": "string", - "enum": [ "gzip" ] - }, - - "fileFormatType": { - "description": "the file format", - "type": "string" - }, - - "fileFormatVersion": { - "description": "the version of the file format", - "type": "string" - } - }, - - "required": [ - "productName", - "vendorName", - "lastEpochMicrosec", - "sourceName", - "startEpochMicrosec", - "timeZoneOffset", - "location", - "compression", - "fileFormatType", - "fileFormatVersion" - ] -} diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/JsonValidatorLibrary.py b/tests/usecases-5G-bulkpm/5G-bulkpm/resources/JsonValidatorLibrary.py deleted file mode 100644 index ed376ff2..00000000 --- a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/JsonValidatorLibrary.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- - -import logging - -from jsonschema import validate, ValidationError, SchemaError -from simplejson import load - - -class JsonValidatorLibrary(object): - - def __init__(self): - pass - - @staticmethod - def validate(schema_path, json_path): - logging.info("Schema path: " + schema_path) - logging.info("JSON path: " + json_path) - schema = None - data = None - try: - schema = load(open(schema_path, 'r')) - data = load(open(json_path, 'r')) - except (IOError, ValueError, OSError) as e: - logging.error(e.message) - return 1 - - try: - validate(data, schema) - except (ValidationError, SchemaError) as e: - logging.error(e.message) - return 1 - - # logger.log("JSON validation successful") - print("JSON validation successful") - return 0 - - -if __name__ == '__main__': - lib = JsonValidatorLibrary() -# sys.exit(JsonValidatorLibrary().validate(sys.argv[1], sys.argv[2])) diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot b/tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot deleted file mode 100644 index 9ef56c83..00000000 --- a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot +++ /dev/null @@ -1,39 +0,0 @@ - *** Settings *** -Documentation The main interface for interacting with VES. It handles low level stuff like managing the http request library and VES required fields -Library RequestsLibrary -Library ../resources/xNFLibrary.py -Library ../resources/JsonValidatorLibrary.py -Library OperatingSystem -Library Collections -Library requests -Library Collections -Library String - -*** Variables *** - -*** Keywords *** - -Get Event Data From File - [Arguments] ${jsonfile} - ${data}= OperatingSystem.Get File ${jsonfile} - #Should Not Be_Equal ${data} None - [return] ${data} - -Publish Event To VES Collector - [Documentation] Send an event to VES Collector - [Arguments] ${url} ${evtpath} ${httpheaders} ${evtdata} - Log Creating session ${url} - ${session}= Create Session dcaegen2-d1 ${url} - ${resp}= Post Request dcaegen2-d1 ${evtpath} data=${evtdata} headers=${httpheaders} - #Log Received response from dcae ${resp.json()} - [return] ${resp} -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} - -GetCall - [Arguments] ${url} - ${resp}= Evaluate requests.get('${url}') requests - [Return] ${resp} diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/xNFLibrary.py b/tests/usecases-5G-bulkpm/5G-bulkpm/resources/xNFLibrary.py deleted file mode 100644 index b70d8095..00000000 --- a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/xNFLibrary.py +++ /dev/null @@ -1,30 +0,0 @@ -''' -Created on Aug 18, 2017 - -@author: sw6830 -''' -import time -import uuid - -from robot.api import logger - - -class xNFLibrary(object): - - def __init__(self): - pass - - @staticmethod - def create_header_from_string(dict_str): - logger.info("Enter create_header_from_string: dictStr") - return dict(u.split("=") for u in dict_str.split(",")) - - @staticmethod - def Generate_UUID(self): - """generate a uuid""" - return uuid.uuid4() - - -if __name__ == '__main__': - lib = xNFLibrary() - time.sleep(100000) |