]> git.stg.codes - stg.git/commitdiff
Beautified test output.
authorMaxim Mamontov <faust.madf@gmail.com>
Fri, 10 Oct 2014 22:30:05 +0000 (01:30 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Fri, 10 Oct 2014 22:30:05 +0000 (01:30 +0300)
functest/do.sh
functest/test.sh
functest/test_admins.sh
functest/test_services.sh

index 277a4b3510d5bf0071f984d6d69b44f5598f08cb..a007aa9bd8d6fd9fbec37ecc86a325a926355010 100755 (executable)
@@ -35,16 +35,12 @@ then
     printf "Failed.\n"
     exit -1
 else
-    printf "Ok.\nTesting... "
+    printf "Ok.\n"
 fi
+
 ./test.sh "$DIR" # >> "$LOGFILE" 2>&1
-if [ "$?" != "0" ]
-then
-    printf "Failed.\n"
-    exit -1
-else
-    printf "Ok.\nCleaning up... "
-fi
+
+printf "Cleaning up... "
 
 $RM -rf $DIR
 if [ "$?" != "0" ]
index 51a0638562c3738912086c95a5b2f4de9b0b553c..333c45e02e0a42a0af9d897833b37729c8bf131d 100755 (executable)
@@ -30,6 +30,8 @@ LOGFILE="$CURPATH/"`date "+%Y-%m-%d-%H%M%S.console.log"`
 
 cd "$STGPATH"
 
+printf "Starting Stargazer... "
+
 "$STGPATH/stargazer" "$STGPATH" >> "$LOGFILE" 2>&1 &
 
 COUNT=""
@@ -50,12 +52,15 @@ do
 done
 
 PID=`cat "$STGPATH/stargazer.pid"`
-printf "\nStarted with pid $PID\n"
+printf "Started with pid $PID\n"
 
+printf "\nTesting admins:\n"
 "$CURPATH/test_admins.sh" "$BASEPATH"
+printf "\nTesting services:\n"
 "$CURPATH/test_services.sh" "$BASEPATH"
+printf "\n"
 
-printf "Stopping...\n"
+printf "Stopping... "
 kill $PID
 
 COUNT=""
index b19df2b080d615ab05f7487497061ad6a3b197d9..dae254ba0aa6cb392428c3e973004a0773ef85c2 100755 (executable)
@@ -6,26 +6,39 @@ BASEPATH=$1
 
 SGCONFPATH="$BASEPATH/stg/projects/sgconf"
 
+printf "Check initial admin list... "
+
 RES=`"$SGCONFPATH/sgconf" -s localhost -p 5555 -u admin -w 123456 --get-admins`
 
 if [ "$?" != "0" ]
 then
+    printf "Error.\n"
     printf "Failed to get admins list. Result:\n$RES\n"
     exit 0
 fi
 
 LOGINS=`getFields "login" "$RES"`
 
-printf "Logins:\n$LOGINS\n"
-
 NUM=`count "$LOGINS"`
 
-printf -- "--------\n$NUM\n\n"
+if [ "$NUM" != "1" ]
+then
+    printf "Failed.\n"
+    printf "Admin list should have exactly one entry.\n"
+    printf "Logins:\n$LOGINS\n"
+    printf -- "--------\n$NUM\n\n"
+    exit 0
+fi
+
+printf "Ok.\nCheck updating admin permissions... "
 
 RES=`"$SGCONFPATH/sgconf" -s localhost -p 5555 -u admin -w 123456 --chg-admin admin --priv 111111111`
 
 if [ "$?" != "0" ]
 then
+    printf "Error\n"
     printf "Failed to update admin's priviledges Result:\n$RES\n"
     exit 0
 fi
+
+printf "Ok.\n"
index 3bc397ae1f298c346246bd1c5ee7f071235c816c..0b8a2a8c7030ca1422679e0567a07a19cd9801bf 100755 (executable)
@@ -6,84 +6,98 @@ BASEPATH=$1
 
 SGCONFPATH="$BASEPATH/stg/projects/sgconf"
 
+printf "Check initial service list... "
+
 RES=`"$SGCONFPATH/sgconf" -s localhost -p 5555 -u admin -w 123456 --get-services`
 
 if [ "$?" != "0" ]
 then
+    printf "Error.\n"
     printf "Failed to get services list. Result:\n$RES\n"
     exit 0
 fi
 
 NAMES=`getFields "name" "$RES"`
 
-printf "Names:\n$NAMES\n"
-
 NUM=`count "$NAMES"`
 
-printf -- "--------\n$NUM\n\n"
-
 if [ "$NUM" != "0" ]
 then
+    printf "Failed.\n"
     printf "Services list should be empty.\n"
+    printf "Names:\n$NAMES\n"
+    printf -- "--------\n$NUM\n\n"
     exit 0
 fi
 
+printf "Ok.\nCheck adding services... "
+
 RES=`"$SGCONFPATH/sgconf" -s localhost -p 5555 -u admin -w 123456 --add-service test`
 
 if [ "$?" != "0" ]
 then
+    printf "Error.\n"
     printf "Failed to add new service. Result:\n$RES\n"
     exit 0
 fi
 
+printf "Ok.\nCheck new service list... "
+
 RES=`"$SGCONFPATH/sgconf" -s localhost -p 5555 -u admin -w 123456 --get-services`
 
 if [ "$?" != "0" ]
 then
+    printf "Error.\n"
     printf "Failed to get services list. Result:\n$RES\n"
     exit 0
 fi
 
 NAMES=`getFields "name" "$RES"`
 
-printf "Names:\n$NAMES\n"
-
 NUM=`count "$NAMES"`
 
-printf -- "--------\n$NUM\n\n"
-
 if [ "$NUM" != "1" ]
 then
+    printf "Failed.\n"
     printf "Services list should have exactly one entry.\n"
+    printf "Names:\n$NAMES\n"
+    printf -- "--------\n$NUM\n\n"
     exit 0
 fi
 
+printf "Ok.\nCheck deletion exisiting service... "
+
 RES=`"$SGCONFPATH/sgconf" -s localhost -p 5555 -u admin -w 123456 --del-service test`
 
 if [ "$?" != "0" ]
 then
+    printf "Error.\n"
     printf "Failed to delete a service. Result:\n$RES\n"
     exit 0
 fi
 
+printf "Ok.\nCheck new service list... "
+
 RES=`"$SGCONFPATH/sgconf" -s localhost -p 5555 -u admin -w 123456 --get-services`
 
 if [ "$?" != "0" ]
 then
+    printf "Error.\n"
     printf "Failed to get services list. Result:\n$RES\n"
     exit 0
 fi
 
 NAMES=`getFields "name" "$RES"`
 
-printf "Names:\n$NAMES\n"
-
 NUM=`count "$NAMES"`
 
-printf -- "--------\n$NUM\n\n"
-
 if [ "$NUM" != "0" ]
 then
+    printf "Failed.\n"
     printf "Services list should be empty.\n"
+    printf "Names:\n$NAMES\n"
+    printf -- "--------\n$NUM\n\n"
     exit 0
 fi
+
+printf "Ok.\n"