Fix MUSIC timing issues on OOF 80/71180/1
authorDileep Ranganathan <dileep.ranganathan@intel.com>
Wed, 24 Oct 2018 12:26:24 +0000 (05:26 -0700)
committerDileep Ranganathan <dileep.ranganathan@intel.com>
Wed, 24 Oct 2018 12:26:24 +0000 (05:26 -0700)
More logging
Longer Delay for TOMCAT
More Delays

Change-Id: Id110687723364586abc354d4fbb1f696589f5e05
Issue-ID: MUSIC-138
Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com>
scripts/optf-has/has/music_script.sh

index 2a4f178..ba37d90 100755 (executable)
@@ -23,12 +23,12 @@ echo "### This is ${WORKSPACE}/scripts/optf-has/has/music_script.sh"
 # add here all the configuration steps eventually needed to be carried out for music CSIT testing
 #
 echo "########## music configuration step ##########";
-CASS_IMG=nexus3.onap.org:10001/onap/music/cassandra_3_11:latest
-CASS_IMG_JOB=nexus3.onap.org:10001/onap/music/cassandra_job:latest
+CASS_IMG=nexus3.onap.org:10001/onap/music/cassandra_3_11:3.0.23
+CASS_IMG_JOB=nexus3.onap.org:10001/onap/music/cassandra_job:3.0.23
 TOMCAT_IMG=nexus3.onap.org:10001/library/tomcat:8.5
 ZK_IMG=nexus3.onap.org:10001/library/zookeeper:3.4
 BUSYBOX_IMG=nexus3.onap.org:10001/library/busybox:latest
-MUSIC_IMG=nexus3.onap.org:10001/onap/music/music:latest
+MUSIC_IMG=nexus3.onap.org:10001/onap/music/music:3.0.23
 TT=10
 WORK_DIR=/tmp/music
 CASS_USERNAME=nelson24
@@ -75,11 +75,11 @@ 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;"
 
+# Sleep 60 seconds to ensure Cassandra is up and running.
+sleep 60;
 # Check to see if Keyspaces are there.
 docker exec music-db cqlsh -u cassandra -p cassandra -e "DESCRIBE keyspaces;"
 
-sleep 10;
-
 # Load data into Cassandra via Cassandra Job
 echo "########## Running Cassandra Job (music-job) to load cql files ##########"
 docker run -d --name music-job --network music-net \
@@ -91,9 +91,22 @@ docker run -d --name music-job --network music-net \
 -e USERNAME=$CASS_USERNAME \
 -e PASSWORD=$CASS_PASSWORD \
 $CASS_IMG_JOB
+
+sleep 70;
+
 # Logs
 echo "########## Cassandra Job logs ##########"
 docker logs music-job
+# Check to see if Keyspaces are there.
+# "############## Check if new username and password work ##########"
+docker exec music-db cqlsh -u $CASS_USERNAME -p $CASS_PASSWORD -e "DESCRIBE keyspaces;"
+# Check to see if Keyspaces are there.
+# "############## Check if original username and password work ##########"
+docker exec music-db cqlsh -u cassandra -p cassandra -e "DESCRIBE keyspaces;"
+# Check to see if Keyspaces are there.
+# "############## Check if new cassandra username and password work ##########"
+docker exec music-db cqlsh -u cassandra -p SomeLongRandomStringNoonewillthinkof -e "DESCRIBE keyspaces;"
+
 
 # Start Music war
 echo "########## Start music-war ##########"
@@ -107,7 +120,7 @@ ZOO_IP=`docker inspect -f '{{ $network := index .NetworkSettings.Networks "music
 echo "ZOOKEEPER_IP=${ZOO_IP}"
 
 # Delay  between Cassandra/Zookeeper and Tomcat
-sleep 10;
+sleep 120;
 
 # Start Up tomcat - Needs to have properties,logs dir and war file volume mapped.
 echo "########## Start Tomcat (music-tomcat) ##########"