aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/dmaap-datarouter
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/dmaap-datarouter')
-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
3 files changed, 46 insertions, 13 deletions
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