blob: cb9f098445bbb52b320918e03e9046cbb25af29c [file] [log] [blame]
Sumithra0736c9f2021-01-05 03:33:28 -08001#!/bin/bash
2
3docker login -u docker -p docker nexus3.onap.org:10001
4
5TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-slice-analysis-ms/testsuites
6TEST_SCRIPTS_DIR=$WORKSPACE/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms
7TEST_ROBOT_DIR=$WORKSPACE/tests/dcaegen2-services-slice-analysis-ms/testcases
denilson.l65e774d8e2021-10-28 05:35:37 +00008TEST_SCRIPTS_CPS_DIR=$WORKSPACE/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai
Sumithra0736c9f2021-01-05 03:33:28 -08009
10docker-compose up -d
11
12ZOOKEEPER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' zookeeper)
13KAFKA_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' kafka)
14DMAAP_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dmaap)
15SLICE_ANALYSIS_MS_POSTGRES_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' slice-analysis-ms-postgres)
16SLICE_ANALYSIS_MS_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sliceanalysisms)
decheng zhang20b23532022-04-10 22:35:55 -040017VESCOLLECTOR_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vescollector)
Sumithra0736c9f2021-01-05 03:33:28 -080018
19echo "Waiting for dmaap to come up ..."
20for i in {1..10}; do
21 dmaap_state=$(curl --write-out '%{http_code}' --silent --output /dev/null $DMAAP_IP:3904/topics)
22 if [ $dmaap_state == "200" ]
23 then
24 break
25 else
26 sleep 60
27 fi
28done
29
30#create topics in dmaap
31curl --header "Content-type: application/json" \
32--request POST \
33--data '{"topicName": "org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS"}' \
34http://$DMAAP_IP:3904/events/unauthenticated.PERFORMANCE_MEASUREMENTS
35
36curl --header "Content-type: application/json" \
37--request POST \
38--data '{"topicName": "DCAE_CL_RSP"}' \
39http://$DMAAP_IP:3904/events/DCAE_CL_RSP
40
41curl --header "Content-type: application/json" \
42--request POST \
43--data '{"topicName": "unauthenticated.ML_RESPONSE_TOPIC"}' \
44http://$DMAAP_IP:3904/events/unauthenticated.ML_RESPONSE_TOPIC
45
46curl --header "Content-type: application/json" \
47--request POST \
48--data '{"topicName": "unauthenticated.DCAE_CL_OUTPUT"}' \
49http://$DMAAP_IP:3904/events/unauthenticated.DCAE_CL_OUTPUT
50
decheng zhang20b23532022-04-10 22:35:55 -040051curl --header "Content-type: application/json" \
52--request POST \
53--data '{"topicName": "unauthenticated.VES_NOTIFICATION_OUTPUT"}' \
54http://$DMAAP_IP:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT
55
56curl --header "Content-type: application/json" \
57--request POST \
58--data '{"topicName": "AAI-EVENT"}' \
59http://$DMAAP_IP:3904/events/AAI-EVENT
60
Sumithra0736c9f2021-01-05 03:33:28 -080061#build configdb-sim image
62cd $TEST_SCRIPTS_DIR
Niranjana9ed698d2022-03-17 09:03:08 +000063docker build -t configdb_des_sim .
Sumithra0736c9f2021-01-05 03:33:28 -080064
65#run configdb-sim
Niranjana9ed698d2022-03-17 09:03:08 +000066docker run -d --name configdb_des_sim --network=testsuites_slice-analysis-ms-default -p "5000:5000" configdb_des_sim:latest;
Sumithra0736c9f2021-01-05 03:33:28 -080067sleep 10
Niranjana9ed698d2022-03-17 09:03:08 +000068CONFIGDB_DES_SIM_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' configdb_des_sim)
69echo "CONFIGDB_DES_SIM_IP=${CONFIGDB_DES_SIM_IP}"
Sumithra0736c9f2021-01-05 03:33:28 -080070
denilson.l65e774d8e2021-10-28 05:35:37 +000071# CPS & AAI set up
72cd $TEST_SCRIPTS_CPS_DIR
73sh cps-aai-setup.sh
decheng zhang20b23532022-04-10 22:35:55 -040074AAI_RESOURCES_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' aai-resources )
75ROBOT_VARIABLES="-v ZOOKEEPER_IP:${ZOOKEEPER_IP} -v KAFKA_IP:${KAFKA_IP} -v DMAAP_IP:${DMAAP_IP} \
76-v SLICE_ANALYSIS_MS_POSTGRES_IP:${SLICE_ANALYSIS_MS_POSTGRES_IP} -v SLICE_ANALYSIS_MS_IP:${SLICE_ANALYSIS_MS_IP} \
77-v CONFIGDB_SIM_IP:${CONFIGDB_SIM_IP} -v TEST_ROBOT_DIR:${TEST_ROBOT_DIR} -v VESCOLLECTOR_IP:${VESCOLLECTOR_IP} \
78-v AAI_RESOURCES_IP:${AAI_RESOURCES_IP}"
denilson.l65e774d8e2021-10-28 05:35:37 +000079