diff options
Diffstat (limited to 'test/csit/plans')
-rwxr-xr-x | test/csit/plans/music/music-test-plan/setup.sh | 26 |
1 files changed, 19 insertions, 7 deletions
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 |