Credentials checking
authorZdeněk Šustr <sustr4@cesnet.cz>
Thu, 11 Sep 2008 09:46:44 +0000 (09:46 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Thu, 11 Sep 2008 09:46:44 +0000 (09:46 +0000)
org.glite.testsuites.ctb/LB/lb-common.sh
org.glite.testsuites.ctb/LB/lb-test-normal-event-delivery-remote.sh

index 443a654..4be088c 100755 (executable)
@@ -37,6 +37,9 @@ LB_LOGD=glite-lb-logd
 LB_INTERLOGD=glite-lb-interlogd
 LB_SERVER=glite-lb-bkserverd
 
+#grid binaries
+GRIDPROXYINFO=grid-proxy-info
+
 # default LB ports
 GLITE_LB_SERVER_PORT=${GLITE_LB_SERVER_PORT:-9000}
 GLITE_LB_IL_SOCK=${GLITE_LB_IL_SOCK:-/tmp/interlogger.sock}
index f73b2a3..b38ffd7 100755 (executable)
@@ -84,54 +84,66 @@ else
        test_done
 fi
 
-# Register job:
-printf "Registering testing job "
-jobid=`${LBJOBREG} -m ${EDG_WL_QUERY_SERVER} -s application | grep "new jobid" | awk '{ print $3 }'`
+printf "Testing credentials"
 
-if [ -z $jobid  ]; then
+proxysubject=`${GRIDPROXYINFO} | ${SYS_GREP} -E "^subject" | ${SYS_SED} "s/subject\s*:\s//"`
+if [ "$proxysubject" = "" ]; then
        test_failed
-       print_error "Failed to register job"
+       print_error "No credentials"
 else
        test_done
-       printf "\nRegistered job: $jobid\n"
-fi
 
-# log events:
-printf "Logging events resulting in READY state\n"
-glite-lb-ready.sh -j ${jobid} > /dev/null 2> /dev/null
 
-printf "Sleeping for 10 seconds (waiting for events to deliver)...\n"
+       # Register job:
+       printf "Registering testing job "
+       jobid=`${LBJOBREG} -m ${EDG_WL_QUERY_SERVER} -s application | grep "new jobid" | awk '{ print $3 }'`
 
-sleep 10
+       if [ -z $jobid  ]; then
+               test_failed
+               print_error "Failed to register job"
+       else
+               test_done
+               printf "\nRegistered job: $jobid\n"
+       fi
 
-jobstate=`${LBJOBSTATUS} ${jobid} | grep "state :" | awk '{print $3}'`
-printf "Is the testing job ($jobid) in a correct state? $jobstate"
+       # log events:
+       printf "Logging events resulting in READY state\n"
+       glite-lb-ready.sh -j ${jobid} > /dev/null 2> /dev/null
 
-if [ "${jobstate}" = "Ready" ]; then
-        test_done
-else
-        test_failed
-        print_error "Job is not in appropriate state"
-fi
+       printf "Sleeping for 10 seconds (waiting for events to deliver)...\n"
 
-printf "Logging events resulting in RUNNING state\n"
-glite-lb-running.sh -j ${jobid} > /dev/null 2> /dev/null
+       sleep 10
 
-printf "Logging events resulting in DONE state\n"
-glite-lb-done.sh -j ${jobid} > /dev/null 2> /dev/null
+       jobstate=`${LBJOBSTATUS} ${jobid} | grep "state :" | awk '{print $3}'`
+       printf "Is the testing job ($jobid) in a correct state? $jobstate"
 
-printf "Sleeping for 10 seconds (waiting for events to deliver)...\n"
+       if [ "${jobstate}" = "Ready" ]; then
+               test_done
+       else
+               test_failed
+               print_error "Job is not in appropriate state"
+       fi
 
-sleep 10
+       printf "Logging events resulting in RUNNING state\n"
+       glite-lb-running.sh -j ${jobid} > /dev/null 2> /dev/null
 
-jobstate=`${LBJOBSTATUS} ${jobid} | grep "state :" | awk '{print $3}'`
-printf "Testing job ($jobid) is in state: $jobstate\n"
+       printf "Logging events resulting in DONE state\n"
+       glite-lb-done.sh -j ${jobid} > /dev/null 2> /dev/null
+
+       printf "Sleeping for 10 seconds (waiting for events to deliver)...\n"
+
+       sleep 10
+
+       jobstate=`${LBJOBSTATUS} ${jobid} | grep "state :" | awk '{print $3}'`
+       printf "Testing job ($jobid) is in state: $jobstate\n"
+
+       if [ "${jobstate}" = "Done" ]; then
+               test_done
+       else
+               test_failed
+               print_error "Job is not in appropriate state"
+       fi
 
-if [ "${jobstate}" = "Done" ]; then
-        test_done
-else
-        test_failed
-        print_error "Job is not in appropriate state"
 fi
 
 test_end