From 31420245bdd75c7955504619310582f1e4c9cbd0 Mon Sep 17 00:00:00 2001 From: "Nelson,Thomas(tn1381)(arthurdent3)" Date: Fri, 21 Sep 2018 00:18:34 -0400 Subject: Update to add Trigger Downloading and setting up Jar for cassandra Minor Fix Missing ; in cql file..... Change-Id: I15c699bac6c13982657d61fa61451f8fa16e5789 Issue-ID: MUSIC-138 Signed-off-by: Nelson,Thomas(tn1381)(arthurdent3) --- test/csit/plans/music/music-test-plan/setup.sh | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'test/csit/plans/music/music-test-plan/setup.sh') diff --git a/test/csit/plans/music/music-test-plan/setup.sh b/test/csit/plans/music/music-test-plan/setup.sh index 6ed31b74b..7775bc52b 100755 --- a/test/csit/plans/music/music-test-plan/setup.sh +++ b/test/csit/plans/music/music-test-plan/setup.sh @@ -39,10 +39,18 @@ MUSIC_SOURCE_PROPERTIES=${WORKSPACE}/test/csit/scripts/music/music-properties MUSIC_PROPERTIES=/tmp/music/properties MUSIC_LOGS=/tmp/music/logs CQL_FILES=${WORKSPACE}/test/csit/scripts/music/cql +MUSIC_TRIGGER_DIR=/tmp/triggers +TRIGGER_JAR=musictrigger-0.1.0.jar +TRIGGER_JAR_URL=https://nexus.onap.org/service/local/repositories/autorelease-72298/content/org/onap/music/musictrigger/0.1.0/musictrigger-0.1.0.jar + mkdir -p ${MUSIC_PROPERTIES} mkdir -p ${MUSIC_LOGS} mkdir -p ${MUSIC_LOGS}/MUSIC +mkdir -p /tmp/triggers +# Get Trigger +echo "########## Get Trigger Jar ##########" +curl -o $MUSIC_TRIGGER_DIR/$TRIGGER_JAR $TRIGGER_JAR_URL cp ${MUSIC_SOURCE_PROPERTIES}/* ${WORK_DIR}/properties @@ -56,7 +64,9 @@ docker network create music-net; # Start Cassandra echo "########## Start Cassandra (music-db) ##########" -docker run -d --name music-db --network music-net -p "7000:7000" -p "7001:7001" -p "7199:7199" -p "9042:9042" -p "9160:9160" -e CASSUSER=${CASS_USERNAME} -e CASSPASS=${CASS_PASSWORD} ${CASS_IMG}; +docker run -d --name music-db --network music-net -p "7000:7000" -p "7001:7001" -p "7199:7199" -p "9042:9042" -p "9160:9160" \ +-v $MUSIC_TRIGGER_DIR/$TRIGGER_JAR:/etc/cassandra/triggers/$TRIGGER_JAR \ +${CASS_IMG}; CASSA_IP=`docker inspect -f '{{ $network := index .NetworkSettings.Networks "music-net" }}{{ $network.IPAddress}}' music-db` echo "CASSANDRA_IP=${CASSA_IP}" @@ -64,7 +74,9 @@ ${WORKSPACE}/test/csit/scripts/optf-has/has/wait_for_port.sh ${CASSA_IP} 9042 # See if cassandra is up. echo "########## Running Test to see if Cassandra is up ##########" -docker run --name music-casstest --network music-net $BUSYBOX_IMG sh -c "until nc -z music-db 9042 && echo "success"; do echo 'No connection .. Sleeping for $TT seconds';sleep $TT; done;" +docker run --name music-casstest --network music-net \ +$BUSYBOX_IMG sh -c "until nc -z music-db 9042 && echo "success"; do echo 'No connection .. Sleeping for $TT seconds';sleep $TT; done;" + # Check to see if Keyspaces are there. docker exec music-db cqlsh -u cassandra -p cassandra -e "DESCRIBE keyspaces;" @@ -75,7 +87,7 @@ echo "########## Running Cassandra Job (music-job) to load cql files ##########" docker run -d --name music-job --network music-net \ -v $CQL_FILES/admin.cql:/cql/admin.cql \ -v $CQL_FILES/admin_pw.cql:/cql/admin_pw.cql \ --v $CQL_FILES/test.cql:/cql/extra/test.cql \ +-v $CQL_FILES/extra:/cql/extra \ -e PORT=9042 \ -e CASS_HOSTNAME=music-db \ -e USERNAME=$CASS_USERNAME \ @@ -116,14 +128,14 @@ sleep 20; echo "########## TOMCAT Logs ##########" docker logs music-tomcat # Needed only if we need to look at localhost logs. -#echo "########## MUSIC localhost Log ##########" -#docker exec music-tomcat /bin/bash -c "cat /usr/local/tomcat/logs/localhost*" +echo "########## MUSIC localhost Log ##########" +docker exec music-tomcat /bin/bash -c "cat /usr/local/tomcat/logs/localhost*" echo "########## MUSIC Log ##########" ls -al $MUSIC_LOGS/MUSIC docker exec music-tomcat /bin/bash -c "cat /opt/app/music/logs/MUSIC/music.log" -echo "########## MUSIC error log ##########" -docker exec music-tomcat /bin/bash -c "cat /opt/app/music/logs/MUSIC/error.log" +#echo "########## MUSIC error log ##########" +#docker exec music-tomcat /bin/bash -c "cat /opt/app/music/logs/MUSIC/error.log" echo "########## inspect docker things for tracing purpose ##########" docker inspect music-db -- cgit 1.2.3-korg