From 2910f56b620972ff58b6dac9f68f4caf4b4c35af Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20=C5=A0ustr?= Date: Tue, 7 Feb 2012 12:13:44 +0000 Subject: [PATCH] Test statistics and remote configuration --- org.glite.testsuites.ctb/LB/tests/lb-test-https.sh | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/org.glite.testsuites.ctb/LB/tests/lb-test-https.sh b/org.glite.testsuites.ctb/LB/tests/lb-test-https.sh index a41e7c7..35cd60d 100755 --- a/org.glite.testsuites.ctb/LB/tests/lb-test-https.sh +++ b/org.glite.testsuites.ctb/LB/tests/lb-test-https.sh @@ -289,6 +289,65 @@ test_done $SYS_RM https.$$.tmp + check_srv_version '>=' "2.3" + if [ $? = 0 ]; then + printf "Checking statistics... " + $SSL_CMD https://${GLITE_WMS_QUERY_SERVER}/?stats > https.$$.tmp + LineNO=`$SYS_WC -l https.$$.tmp | $SYS_AWK '{ print $1 }' ` + if [ ! "$LineNO" == "0" ]; then + test_done + printf "Checking for items that should be > 0... " + for item in "gLite job regs" "Notification regs.*legacy" "HTML accesses" "Plain text accesses" + do + printf "$item... " + ItLine=`$SYS_GREP -E "$item" https.$$.tmp` + if [ "$?" == "0" ]; then + ItValue=`$SYS_ECHO $ItLine | $SYS_GREP -o -E -i "[0-9]+" | $SYS_GREP -o -E -i "[0-9]+"` + printf "$ItValue " + if [ "$ItValue" != "" -a $ItValue -gt 0 ]; then + test_done + else + test_failed + print_error "A numeric value greater tha zero should have been returned" + fi + else + test_failed + print_error "Value $item not returned" + fi + done + else + test_failed + print_error "Statistics not returned" + fi + + printf "Downloading remote configuration... " + $SSL_CMD https://${GLITE_WMS_QUERY_SERVER}/?configuration > https.$$.tmp + LineNO=`$SYS_WC -l https.$$.tmp | $SYS_AWK '{ print $1 }' ` + if [ ! "$LineNO" == "0" ]; then + test_done + printf "Checking for items... " + for item in msg_brokers msg_prefixes + do + printf "$item... " + $SYS_GREP -E "$item.*=" https.$$.tmp > /dev/null + if [ "$?" == "0" ]; then + test_done + else + test_failed + print_error "Value $item not returned" + fi + done + else + test_failed + print_error "Statistics not returned" + fi + + $SYS_RM https.$$.tmp + else + printf "Statistics and remote configuration tests... " + test_skipped + fi + test_end } #} &> $logfile -- 1.8.2.3