Reverse order of conf/stat tests
authorZdeněk Šustr <sustr4@cesnet.cz>
Thu, 16 Feb 2012 15:24:23 +0000 (15:24 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Thu, 16 Feb 2012 15:24:23 +0000 (15:24 +0000)
org.glite.testsuites.ctb/LB/tests/lb-test-https.sh

index 35cd60d..35eeec6 100755 (executable)
@@ -291,25 +291,18 @@ test_done
 
                        check_srv_version '>=' "2.3"
                        if [ $? = 0 ]; then
-                               printf "Checking statistics... "
-                               $SSL_CMD https://${GLITE_WMS_QUERY_SERVER}/?stats > https.$$.tmp
+                               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 that should be > 0... "
-                                       for item in "gLite job regs" "Notification regs.*legacy" "HTML accesses" "Plain text accesses"
+                                       printf "Checking for items... "
+                                       for item in msg_brokers msg_prefixes 
                                        do
                                                printf "$item... "
-                                               ItLine=`$SYS_GREP -E "$item" https.$$.tmp`
+                                               $SYS_GREP -E "$item.*=" https.$$.tmp > /dev/null
                                                if [ "$?" == "0" ]; then
-                                                       ItValue=`$SYS_ECHO $ItLine | $SYS_GREP -o -E -i "<td>[0-9]+</td>" | $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
+                                                       test_done
                                                else
                                                        test_failed
                                                        print_error "Value $item not returned"
@@ -320,18 +313,25 @@ test_done
                                        print_error "Statistics not returned"
                                fi
 
-                               printf "Downloading remote configuration... "
-                               $SSL_CMD https://${GLITE_WMS_QUERY_SERVER}/?configuration > https.$$.tmp
+                               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... "
-                                       for item in msg_brokers msg_prefixes 
+                                       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... "
-                                               $SYS_GREP -E "$item.*=" https.$$.tmp > /dev/null
+                                               ItLine=`$SYS_GREP -E "$item" https.$$.tmp`
                                                if [ "$?" == "0" ]; then
-                                                       test_done
+                                                       ItValue=`$SYS_ECHO $ItLine | $SYS_GREP -o -E -i "<td>[0-9]+</td>" | $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"