blob: 6f895a1e4a27b56d425903e03efbd2e76aa8a17a [file] [log] [blame]
Niranjana3d457a02020-08-12 13:33:22 +05301#!/bin/bash
2
3docker login -u docker -p docker nexus3.onap.org:10001
4
5TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-son-handler/testsuites
6TEST_SCRIPTS_DIR=$WORKSPACE/scripts/dcaegen2-services-son-handler/sonhandler
7TEST_ROBOT_DIR=$WORKSPACE/tests/dcaegen2-services-son-handler/testcases
8
9docker-compose up -d
10
11ZOOKEEPER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' zookeeper)
12KAFKA_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' kafka)
13DMAAP_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dmaap)
14SONHMS_POSTGRES_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sonhms-postgres)
15SONHMS_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sonhms.onap)
16
17echo "Waiting for dmaap to come up ..."
18for i in {1..10}; do
19 dmaap_state=$(curl --write-out '%{http_code}' --silent --output /dev/null $DMAAP_IP:3904/topics)
20 if [ $dmaap_state == "200" ]
21 then
22 break
23 else
24 sleep 60
25 fi
26done
27
28#create topics
29curl --header "Content-type: application/json" \
30--request POST \
31--data '{"topicName": "DCAE_CL_RSP"}' \
32http://$DMAAP_IP:3904/events/DCAE_CL_RSP
33
34curl --header "Content-type: application/json" \
35--request POST \
36--data '{"topicName": "unauthenticated.SEC_FAULT_OUTPUT"}' \
37http://$DMAAP_IP:3904/events/unauthenticated.SEC_FAULT_OUTPUT
38
39curl --header "Content-type: application/json" \
40--request POST \
41--data '{"topicName": "unauthenticated.VES_MEASUREMENT_OUTPUT"}' \
42http://$DMAAP_IP:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT
43
44curl --header "Content-type: application/json" \
45--request POST \
46--data '{"topicName": "unauthenticated.DCAE_CL_OUTPUT"}' \
47http://$DMAAP_IP:3904/events/unauthenticated.DCAE_CL_OUTPUT
48echo "topics created"
49
50#build configdb-oof-sim image
51cd $TEST_SCRIPTS_DIR
52docker build -t configdb_oof_sim .
53
54#run configdb-oof-sim
55docker run -d --name configdb_oof_sim --network=testsuites_sonhms-default -p "5000:5000" configdb_oof_sim:latest;
56sleep 60
57CONFIGDB_OOF_SIM_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' configdb_oof_sim)
58echo "CONFIGDB_OOF_SIM_IP=${CONFIGDB_OOF_SIM_IP}"
59
60
61ROBOT_VARIABLES="-v ZOOKEEPER_IP:${ZOOKEEPER_IP} -v KAFKA_IP:${KAFKA_IP} -v DMAAP_IP:${DMAAP_IP} -v SONHMS_POSTGRES_IP:${SONHMS_POSTGRES_IP} -v SONHMS_IP:${SONHMS_IP} -v CONFIGDB_OOF_SIM_IP:${CONFIGDB_OOF_SIM_IP} -v TEST_ROBOT_DIR:${TEST_ROBOT_DIR}"