BDII extended with checking for server version through WS and comparing it to that...
authorZdeněk Šustr <sustr4@cesnet.cz>
Thu, 4 Mar 2010 12:00:27 +0000 (12:00 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Thu, 4 Mar 2010 12:00:27 +0000 (12:00 +0000)
org.glite.testsuites.ctb/LB/tests/lb-common.sh
org.glite.testsuites.ctb/LB/tests/lb-test-bdii.sh

index 4654d64..4bd5014 100755 (executable)
@@ -31,6 +31,7 @@ LBJOBREG=glite-lb-job_reg
 LBUSERJOBS=glite-lb-user_jobs
 LBJOBSTATUS=glite-lb-job_status
 LBWSJOBSTATUS=glite-lb-ws_jobstat
+LBWSGETVERSION=glite-lb-ws_getversion
 LBPURGE=glite-lb-purge
 LBCHANGEACL=glite-lb-change_acl
 LBMON=glite-lb-lbmon
index e865934..8c3b12e 100755 (executable)
@@ -74,13 +74,41 @@ test_start
 
 
 # check_binaries
-printf "Testing if all binaries are available"
+printf "Testing if all essential binaries are available"
 check_binaries $SYS_GREP $SYS_SED $SYS_AWK $SYS_LDAPSEARCH
 if [ $? -gt 0 ]; then
        test_failed
 else
        test_done
 
+       printf "Testing optional WS client binary"
+       check_binaries $LBWSGETVERSION
+       if [ $? -gt 0 ]; then
+               printf " ... not present. Some tests will be skipped\n"
+               WSBIN="no"
+       else
+               test_done
+
+               printf "Testing credentials"
+
+               timeleft=`${GRIDPROXYINFO} | ${SYS_GREP} -E "^timeleft" | ${SYS_SED} "s/timeleft\s*:\s//"`
+
+               if [ "$timeleft" = "" ]; then
+                       printf "No credentials, not critical\n"
+                       WSBIN="no"
+               else
+                       if [ "$timeleft" = "0:00:00" ]; then
+                               printf "Credentials expired, not critical\n"
+                               WSBIN="no"
+                       else
+                               test_done
+                               WSBIN="yes"
+                       fi
+
+               fi
+
+       fi
+
        # Register job:
 
        server=`${SYS_ECHO} ${GLITE_WMS_QUERY_SERVER} | ${SYS_SED} 's/:.*$//'`
@@ -111,6 +139,27 @@ else
        else
                printf "$glservver"
                test_done
+
+               printf "Reading version through WS... "
+               if [ "$WSBIN" == "yes" ]; then
+                       servername=`echo ${GLITE_WMS_QUERY_SERVER} | ${SYS_SED} "s/:.*//"`
+                       wsglservver=`$LBWSGETVERSION -m ${servername}:${GLITE_LB_SERVER_WPORT} | $SYS_SED 's/^.*Server version:\s*//'`
+                       if [ "$wsglservver" == "" ]; then       
+                               test_failed
+                       else
+                               printf "$wsglservver"
+                               test_done
+
+                               printf "Comparing versions: $glservver == $wsglservver"
+                               if [ "$glservver" == "$wsglservver" ]; then
+                                       test_done
+                               else
+                                       test_failed
+                               fi
+                       fi
+               else
+                       test_skipped
+               fi
        fi
 
        printf "Checking Glue 2.0 entry with 'o=glue'... "