aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/plans/music
diff options
context:
space:
mode:
authorLeonardo Bellini <leonardo.bellini@att.com>2018-03-14 03:59:33 -0500
committerLeonardo Bellini <leonardo.bellini@att.com>2018-03-14 03:59:50 -0500
commitd573946672ae77de0731bda6c05cbb8bdd1ecbbc (patch)
tree0bf929298142b6fed00a1caadd5af90467d74015 /test/csit/plans/music
parent5ae17fe0c827f93e2065a1648fc7073009fe293e (diff)
Add more test cases to Music 2
Issue-ID: MUSIC-54 Change-Id: Iecde3e2528c394d06bab61f383a543d1e857674e Signed-off-by: Leonardo Bellini <leonardo.bellini@att.com>
Diffstat (limited to 'test/csit/plans/music')
-rwxr-xr-xtest/csit/plans/music/music-test-plan/setup.sh60
-rwxr-xr-xtest/csit/plans/music/music-test-plan/teardown.sh5
2 files changed, 44 insertions, 21 deletions
diff --git a/test/csit/plans/music/music-test-plan/setup.sh b/test/csit/plans/music/music-test-plan/setup.sh
index 900ccf660..63d2ef93f 100755
--- a/test/csit/plans/music/music-test-plan/setup.sh
+++ b/test/csit/plans/music/music-test-plan/setup.sh
@@ -25,32 +25,51 @@ source ${WORKSPACE}/test/csit/scripts/music/music-scripts/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_music:latest
+TOMCAT_IMG=nexus3.onap.org:10001/library/tomcat:8.0
+ZK_IMG=nexus3.onap.org:10001/library/zookeeper:3.4
+MUSIC_IMG=nexus3.onap.org:10001/onap/music/music:latest
+WORK_DIR=/tmp/music
+CASS_USERNAME=nelson24
+CASS_PASSWORD=winman123
MUSIC_SOURCE_PROPERTIES=${WORKSPACE}/test/csit/scripts/music/music-properties
MUSIC_PROPERTIES=/tmp/music/properties
MUSIC_LOGS=/tmp/music/logs
-
mkdir -p ${MUSIC_PROPERTIES}
mkdir -p ${MUSIC_LOGS}
-cp ${MUSIC_SOURCE_PROPERTIES}/* ${MUSIC_PROPERTIES}
+cp ${MUSIC_SOURCE_PROPERTIES}/* ${WORK_DIR}/properties
+
+# Create Volume for mapping war file and tomcat
+docker volume create --name music-vol;
+
+# Create a network for all the containers to run in.
+docker network create music-net;
+
+# Start Cassandra
+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};
+
+# Start Music war
+docker run -d --name music-war -v music-vol:/app ${MUSIC_IMG};
-#docker cp /home/lb7254/integration/test/csit/scripts/music/music-scripts/music_init.cql cassandra:/tmp/music_init.cql
-#docker cp ${WORKSPACE}/test/csit/scripts/music/music-scripts/music_init.cql cassandra:/tmp/music_init.cql
-#docker exec -it cassandra /usr/bin/cqlsh -umusic -pmusic -f /tmp/music_init.cql
+# Start Zookeeper
+docker run -d --name music-zk --network music-net -p "2181:2181" -p "2888:2888" -p "3888:3888" ${ZK_IMG};
+# Delay for Cassandra
+sleep 20;
+# Start Up tomcat - Needs to have properties,logs dir and war file volume mapped.
+docker run -d --name music-tomcat --network music-net -p "8080:8080" -v music-vol:/usr/local/tomcat/webapps -v ${WORK_DIR}/properties:/opt/app/music/etc:ro -v ${WORK_DIR}/logs:/opt/app/music/logs ${TOMCAT_IMG};
+
+# Connect tomcat to host bridge network so that its port can be seen.
+docker network connect bridge music-tomcat;
+
+##################################
#
# add here below the start of all docker containers needed for music CSIT testing
#
-echo "# music docker containers spinoff";
-
-
-docker volume create --name music-vol
-docker run -d --name music-war -v music-vol:/app nexus3.onap.org:10001/onap/music/music:latest
-docker run -d --name music-db -p 7000:7000 -p 7001:7001 -p 7199:7199 -p 9042:9042 -p 9160:9160 nexus3.onap.org:10001/onap/music/cassandra_music:latest
-docker run -d --name music-zk -p 2181:2181 -p 2888:2888 -p 3888:3888 nexus3.onap.org:10001/library/zookeeper:3.4
-sleep 30
CASSA_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' music-db`
echo "CASSANDRA_IP=${CASSA_IP}"
@@ -60,20 +79,19 @@ echo "ZOOKEEPER_IP=${ZOO_IP}"
${WORKSPACE}/test/csit/scripts/music/music-scripts/wait_for_port.sh ${CASSA_IP} 9042
-docker run -d --name music-tomcat -p 8080:8080 -v music-vol:/usr/local/tomcat/webapps -v ${MUSIC_PROPERTIES}:/opt/app/music/etc:ro -v ${MUSIC_LOGS}:/opt/app/music/logs nexus3.onap.org:10001/library/tomcat:8.0
-sleep 10
-
TOMCAT_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' music-tomcat`
echo "TOMCAT_IP=${TOMCAT_IP}"
${WORKSPACE}/test/csit/scripts/music/music-scripts/wait_for_port.sh ${TOMCAT_IP} 8080
---- old part: it will be removed
-#docker run --name cassandra -d -p 9042:9042 -p 7000:7000 -p 7001:7001 -p 7199:7199 -p 9160:9160 nexus3.onap.org:10001/library/cassandra
-#docker run --name zookeeper -d -p 2181:2181 -p 2888:2888 -p 3888:3888 nexus3.onap.org:10001/library/zookeeper
-#docker run --name music -d -v /app nexus3.onap.org:10001/music
-#docker run --name tomcat -d -p 8080:8080 --volumes-from music nexus3.onap.org:10001/library/tomcat
+echo "inspect docker things for tracing purpose"
+docker inspect music-db
+docker inspect music-zk
+docker inspect music-tomcat
+docker inspect music-war
+docker volume inspect music-vol
+docker network inspect music-net
diff --git a/test/csit/plans/music/music-test-plan/teardown.sh b/test/csit/plans/music/music-test-plan/teardown.sh
index 315be04a8..e9982ae27 100755
--- a/test/csit/plans/music/music-test-plan/teardown.sh
+++ b/test/csit/plans/music/music-test-plan/teardown.sh
@@ -34,12 +34,17 @@ docker rm music-tomcat
docker rm music-war
docker rm music-db
+docker network rm music-net;
+sleep 5;
+
docker volume rm music-vol
echo "dump music.log files"
ls -alF /tmp/music
ls -alF /tmp/music/properties
+cat /tmp/music/properties/music.properties
cat /tmp/music/logs/MUSIC/music.log
+cat /tmp/music/logs/MUSIC/error.log
#rm -Rf /tmp/music