Sumithra | 0736c9f | 2021-01-05 03:33:28 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | docker login -u docker -p docker nexus3.onap.org:10001 |
| 4 | |
| 5 | TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-slice-analysis-ms/testsuites |
| 6 | TEST_SCRIPTS_DIR=$WORKSPACE/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms |
| 7 | TEST_ROBOT_DIR=$WORKSPACE/tests/dcaegen2-services-slice-analysis-ms/testcases |
denilson.l65 | e774d8e | 2021-10-28 05:35:37 +0000 | [diff] [blame] | 8 | TEST_SCRIPTS_CPS_DIR=$WORKSPACE/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai |
Sumithra | 0736c9f | 2021-01-05 03:33:28 -0800 | [diff] [blame] | 9 | |
| 10 | docker-compose up -d |
| 11 | |
| 12 | ZOOKEEPER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' zookeeper) |
| 13 | KAFKA_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' kafka) |
| 14 | DMAAP_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dmaap) |
| 15 | SLICE_ANALYSIS_MS_POSTGRES_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' slice-analysis-ms-postgres) |
| 16 | SLICE_ANALYSIS_MS_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sliceanalysisms) |
decheng zhang | 20b2353 | 2022-04-10 22:35:55 -0400 | [diff] [blame] | 17 | VESCOLLECTOR_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vescollector) |
Sumithra | 0736c9f | 2021-01-05 03:33:28 -0800 | [diff] [blame] | 18 | |
| 19 | echo "Waiting for dmaap to come up ..." |
| 20 | for 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 |
| 28 | done |
| 29 | |
| 30 | #create topics in dmaap |
| 31 | curl --header "Content-type: application/json" \ |
| 32 | --request POST \ |
| 33 | --data '{"topicName": "org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS"}' \ |
| 34 | http://$DMAAP_IP:3904/events/unauthenticated.PERFORMANCE_MEASUREMENTS |
| 35 | |
| 36 | curl --header "Content-type: application/json" \ |
| 37 | --request POST \ |
| 38 | --data '{"topicName": "DCAE_CL_RSP"}' \ |
| 39 | http://$DMAAP_IP:3904/events/DCAE_CL_RSP |
| 40 | |
| 41 | curl --header "Content-type: application/json" \ |
| 42 | --request POST \ |
| 43 | --data '{"topicName": "unauthenticated.ML_RESPONSE_TOPIC"}' \ |
| 44 | http://$DMAAP_IP:3904/events/unauthenticated.ML_RESPONSE_TOPIC |
| 45 | |
| 46 | curl --header "Content-type: application/json" \ |
| 47 | --request POST \ |
| 48 | --data '{"topicName": "unauthenticated.DCAE_CL_OUTPUT"}' \ |
| 49 | http://$DMAAP_IP:3904/events/unauthenticated.DCAE_CL_OUTPUT |
| 50 | |
decheng zhang | 20b2353 | 2022-04-10 22:35:55 -0400 | [diff] [blame] | 51 | curl --header "Content-type: application/json" \ |
| 52 | --request POST \ |
| 53 | --data '{"topicName": "unauthenticated.VES_NOTIFICATION_OUTPUT"}' \ |
| 54 | http://$DMAAP_IP:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT |
| 55 | |
| 56 | curl --header "Content-type: application/json" \ |
| 57 | --request POST \ |
| 58 | --data '{"topicName": "AAI-EVENT"}' \ |
| 59 | http://$DMAAP_IP:3904/events/AAI-EVENT |
| 60 | |
Sumithra | 0736c9f | 2021-01-05 03:33:28 -0800 | [diff] [blame] | 61 | #build configdb-sim image |
| 62 | cd $TEST_SCRIPTS_DIR |
Niranjana | 9ed698d | 2022-03-17 09:03:08 +0000 | [diff] [blame] | 63 | docker build -t configdb_des_sim . |
Sumithra | 0736c9f | 2021-01-05 03:33:28 -0800 | [diff] [blame] | 64 | |
| 65 | #run configdb-sim |
Niranjana | 9ed698d | 2022-03-17 09:03:08 +0000 | [diff] [blame] | 66 | docker run -d --name configdb_des_sim --network=testsuites_slice-analysis-ms-default -p "5000:5000" configdb_des_sim:latest; |
Sumithra | 0736c9f | 2021-01-05 03:33:28 -0800 | [diff] [blame] | 67 | sleep 10 |
Niranjana | 9ed698d | 2022-03-17 09:03:08 +0000 | [diff] [blame] | 68 | CONFIGDB_DES_SIM_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' configdb_des_sim) |
| 69 | echo "CONFIGDB_DES_SIM_IP=${CONFIGDB_DES_SIM_IP}" |
Sumithra | 0736c9f | 2021-01-05 03:33:28 -0800 | [diff] [blame] | 70 | |
denilson.l65 | e774d8e | 2021-10-28 05:35:37 +0000 | [diff] [blame] | 71 | # CPS & AAI set up |
| 72 | cd $TEST_SCRIPTS_CPS_DIR |
| 73 | sh cps-aai-setup.sh |
decheng zhang | 20b2353 | 2022-04-10 22:35:55 -0400 | [diff] [blame] | 74 | AAI_RESOURCES_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' aai-resources ) |
| 75 | ROBOT_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.l65 | e774d8e | 2021-10-28 05:35:37 +0000 | [diff] [blame] | 79 | |