Update runcql 08/70608/2
authorNelson,Thomas(tn1381)(arthurdent3) <tn1381@att.com>
Tue, 16 Oct 2018 23:05:47 +0000 (19:05 -0400)
committerNelson,Thomas(tn1381)(arthurdent3) <tn1381@att.com>
Tue, 16 Oct 2018 23:34:30 +0000 (19:34 -0400)
Change-Id: Ieedb7a180de8bd591c610d0846e33b3a95daad8d
Issue-ID: MUSIC-147
Signed-off-by: Nelson,Thomas(tn1381)(arthurdent3) <tn1381@att.com>
distribution/cassandra_job/runcql.sh

index 078edf7..f935a35 100644 (file)
@@ -1,12 +1,12 @@
 #! /bin/bash
-re='^[0-9]+$'
-if [[ $TIMEOUT =~ $re ]]; then
-    echo "TIMEOUT not set or error, defaulting to 10 seconds"
-    TIMEOUT=10
+if [ -z "$TIMEOUT" ]; then
+    TIMEOUT=10;
 fi
 TO="--request-timeout=$TIMEOUT"
 
 if [ $CASS_HOSTNAME ]; then
+    echo "Sleeping for 60 seconds before running cql";
+    sleep 60;
     >&2 echo "#############################################"
     >&2 echo "############## Let run cql's ################"
     >&2 echo "#############################################"
@@ -71,9 +71,9 @@ if [ $CASS_HOSTNAME ]; then
     fi
 
     >&2 echo "Running Test - look for admin keyspace:"
-    >&2 echo "Running cqlsh -u $DEF_USER -p $DEF_PASS -e "describe keyspaces;" ${CASS_HOSTNAME} ${PORT}"
+    >&2 echo "Running cqlsh -u $USERNAME -p $PASSWORD -e "select * from system_auth.roles;" ${CASS_HOSTNAME} ${PORT}"
     sleep 1;
-    if cqlsh $TO -u $DEF_USER -p $DEF_PASS -e "describe keyspaces;" ${CASS_HOSTNAME} ${PORT} | grep admin;
+    if cqlsh $TO -u $USERNAME -p $PASSWORD -e "select * from system_auth.roles;" ${CASS_HOSTNAME} ${PORT}
     then
         >&2 echo "Success - running test";
     else