aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLasse Kaihlavirta <l.kaihlavirt@partner.samsung.com>2021-03-31 14:21:59 +0000
committerGerrit Code Review <gerrit@onap.org>2021-03-31 14:21:59 +0000
commit7b4a3af0a9e4a0046b303e532640bc3e4a3420e5 (patch)
tree6dcb9a3be830abb6af8b847b83b29602327a49b4 /scripts
parentddd487752cf6eddd891d7b8fe5062316a932414d (diff)
parent3d202b5a5f14587852e8519def7a07c4ca477686 (diff)
Merge "[DMAAP] Refactoring dmaap suites"
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/dmaap-buscontroller/dmaapbc-init.sh50
-rwxr-xr-xscripts/dmaap-buscontroller/dmaapbc-launch.sh37
-rw-r--r--scripts/dmaap-buscontroller/docker-compose/buscontroller.env4
-rw-r--r--scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.cred.props17
-rw-r--r--scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.jksbin0 -> 4719 bytes
-rw-r--r--scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.location.props8
-rw-r--r--scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.props24
-rw-r--r--scripts/dmaap-buscontroller/docker-compose/cadi_aaf/truststore.jksbin0 -> 3234 bytes
-rw-r--r--scripts/dmaap-buscontroller/docker-compose/dmaapbc.properties168
-rw-r--r--scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml25
-rw-r--r--scripts/dmaap-buscontroller/docker-compose/logback.xml356
-rw-r--r--scripts/dmaap-buscontroller/dr-launch.sh58
-rwxr-xr-xscripts/dmaap-buscontroller/init-mock-aaf.sh53
-rwxr-xr-xscripts/dmaap-buscontroller/init-mock-drps.sh17
-rwxr-xr-xscripts/dmaap-buscontroller/init-mock-mrc.sh17
-rw-r--r--scripts/dmaap-buscontroller/onapCSIT.env18
-rwxr-xr-xscripts/dmaap-buscontroller/start-mock.sh51
-rw-r--r--scripts/dmaap-datarouter/datarouter-launch.sh14
-rwxr-xr-xscripts/dmaap-datarouter/datarouter-teardown.sh33
-rw-r--r--scripts/dmaap-datarouter/docker-compose/docker-compose.yml12
-rwxr-xr-xscripts/dmaap-message-router/dmaap-mr-launch.sh180
21 files changed, 767 insertions, 375 deletions
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
new file mode 100644
index 00000000..ca8301ca
--- /dev/null
+++ b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.jks
Binary files differ
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
new file mode 100644
index 00000000..91547c60
--- /dev/null
+++ b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/truststore.jks
Binary files differ
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
}