summaryrefslogtreecommitdiffstats
path: root/test/csit
diff options
context:
space:
mode:
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}