From 82306bcf072ff5fe4174a4e88b8b188975656742 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20=C5=A0ustr?= Date: Thu, 11 Sep 2008 09:46:44 +0000 Subject: [PATCH] Credentials checking --- org.glite.testsuites.ctb/LB/lb-common.sh | 3 + .../LB/lb-test-normal-event-delivery-remote.sh | 78 +++++++++++++--------- 2 files changed, 48 insertions(+), 33 deletions(-) diff --git a/org.glite.testsuites.ctb/LB/lb-common.sh b/org.glite.testsuites.ctb/LB/lb-common.sh index 443a654..4be088c 100755 --- a/org.glite.testsuites.ctb/LB/lb-common.sh +++ b/org.glite.testsuites.ctb/LB/lb-common.sh @@ -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} diff --git a/org.glite.testsuites.ctb/LB/lb-test-normal-event-delivery-remote.sh b/org.glite.testsuites.ctb/LB/lb-test-normal-event-delivery-remote.sh index f73b2a3..b38ffd7 100755 --- a/org.glite.testsuites.ctb/LB/lb-test-normal-event-delivery-remote.sh +++ b/org.glite.testsuites.ctb/LB/lb-test-normal-event-delivery-remote.sh @@ -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 -- 1.8.2.3