summaryrefslogtreecommitdiffstats
path: root/test/csit
diff options
context:
space:
mode:
authorNelson,Thomas(tn1381)(arthurdent3) <tn1381@att.com>2018-09-21 00:18:34 -0400
committerNelson,Thomas(tn1381)(arthurdent3) <tn1381@att.com>2018-09-21 02:09:52 -0400
commit31420245bdd75c7955504619310582f1e4c9cbd0 (patch)
treedbbbf002c9c10657196ea5380997218e8b0eb176 /test/csit
parent5d7183c56ee613b5fb3f03ff2f64a6a0ed646e86 (diff)
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) <tn1381@att.com>
Diffstat (limited to 'test/csit')
-rwxr-xr-xtest/csit/plans/music/music-test-plan/setup.sh26
-rw-r--r--test/csit/scripts/music/cql/admin.cql15
-rw-r--r--test/csit/scripts/music/cql/extra/test.cql (renamed from test/csit/scripts/music/cql/test.cql)0
-rw-r--r--test/csit/tests/music/music-suite/music-test.robot20
4 files changed, 54 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
diff --git a/test/csit/scripts/music/cql/admin.cql b/test/csit/scripts/music/cql/admin.cql
index 65b4dbf93..df13f32ae 100644
--- a/test/csit/scripts/music/cql/admin.cql
+++ b/test/csit/scripts/music/cql/admin.cql
@@ -16,4 +16,19 @@ CREATE TABLE IF NOT EXISTS admin.keyspace_master (
PRIMARY KEY (uuid)
);
+CREATE TABLE IF NOT EXISTS admin.notification_master (
+ id uuid,
+ current_notifier text,
+ endpoint_password blob,
+ endpoint_userid text,
+ notify_delete_on text,
+ notify_insert_on text,
+ notify_to_endpoint text,
+ notify_update_on text,
+ notifyon text PRIMARY KEY,
+ request text
+);
+
+
+
describe keyspace admin;
diff --git a/test/csit/scripts/music/cql/test.cql b/test/csit/scripts/music/cql/extra/test.cql
index 6a5872011..6a5872011 100644
--- a/test/csit/scripts/music/cql/test.cql
+++ b/test/csit/scripts/music/cql/extra/test.cql
diff --git a/test/csit/tests/music/music-suite/music-test.robot b/test/csit/tests/music/music-suite/music-test.robot
index 9fc937e49..4eda86919 100644
--- a/test/csit/tests/music/music-suite/music-test.robot
+++ b/test/csit/tests/music/music-suite/music-test.robot
@@ -49,6 +49,26 @@ Check Music War Docker Container
Should Be Equal As Integers ${rc} 0
Should Contain ${output} music-war
+Healthcheck Cassandra
+ [Documentation] It sends a REST GET request to retrieve the Music.war version
+ Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Get Request musicaas /MUSIC/rest/v2/service/pingCassandra/ONE headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+
+Healthcheck Zookeeper
+ [Documentation] It sends a REST GET request to retrieve the Music.war version
+ Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Get Request musicaas /MUSIC/rest/v2/service/pingZookeeper headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+
Get Music Version
[Documentation] It sends a REST GET request to retrieve the Music.war version
Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT}