Niranjana | 3d457a0 | 2020-08-12 13:33:22 +0530 | [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-son-handler/testsuites |
| 6 | TEST_SCRIPTS_DIR=$WORKSPACE/scripts/dcaegen2-services-son-handler/sonhandler |
| 7 | TEST_ROBOT_DIR=$WORKSPACE/tests/dcaegen2-services-son-handler/testcases |
| 8 | |
| 9 | docker-compose up -d |
| 10 | |
| 11 | ZOOKEEPER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' zookeeper) |
| 12 | KAFKA_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' kafka) |
| 13 | DMAAP_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dmaap) |
| 14 | SONHMS_POSTGRES_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sonhms-postgres) |
| 15 | SONHMS_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sonhms.onap) |
| 16 | |
| 17 | echo "Waiting for dmaap to come up ..." |
| 18 | for 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 |
| 26 | done |
| 27 | |
| 28 | #create topics |
| 29 | curl --header "Content-type: application/json" \ |
| 30 | --request POST \ |
| 31 | --data '{"topicName": "DCAE_CL_RSP"}' \ |
| 32 | http://$DMAAP_IP:3904/events/DCAE_CL_RSP |
| 33 | |
| 34 | curl --header "Content-type: application/json" \ |
| 35 | --request POST \ |
| 36 | --data '{"topicName": "unauthenticated.SEC_FAULT_OUTPUT"}' \ |
| 37 | http://$DMAAP_IP:3904/events/unauthenticated.SEC_FAULT_OUTPUT |
| 38 | |
| 39 | curl --header "Content-type: application/json" \ |
| 40 | --request POST \ |
| 41 | --data '{"topicName": "unauthenticated.VES_MEASUREMENT_OUTPUT"}' \ |
| 42 | http://$DMAAP_IP:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT |
| 43 | |
| 44 | curl --header "Content-type: application/json" \ |
| 45 | --request POST \ |
| 46 | --data '{"topicName": "unauthenticated.DCAE_CL_OUTPUT"}' \ |
| 47 | http://$DMAAP_IP:3904/events/unauthenticated.DCAE_CL_OUTPUT |
| 48 | echo "topics created" |
| 49 | |
| 50 | #build configdb-oof-sim image |
| 51 | cd $TEST_SCRIPTS_DIR |
| 52 | docker build -t configdb_oof_sim . |
| 53 | |
| 54 | #run configdb-oof-sim |
| 55 | docker run -d --name configdb_oof_sim --network=testsuites_sonhms-default -p "5000:5000" configdb_oof_sim:latest; |
| 56 | sleep 60 |
| 57 | CONFIGDB_OOF_SIM_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' configdb_oof_sim) |
| 58 | echo "CONFIGDB_OOF_SIM_IP=${CONFIGDB_OOF_SIM_IP}" |
| 59 | |
| 60 | |
| 61 | ROBOT_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}" |