From 219aab6d3f8506d8df670455007cb14bc70919f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20=C5=A0ustr?= Date: Wed, 1 Apr 2009 14:11:03 +0000 Subject: [PATCH] Merge 313_5 -> 313_6 --- .../examples/ws_status_history_test.sh | 85 ++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100755 org.glite.lb.ws-test/examples/ws_status_history_test.sh diff --git a/org.glite.lb.ws-test/examples/ws_status_history_test.sh b/org.glite.lb.ws-test/examples/ws_status_history_test.sh new file mode 100755 index 0000000..1e6f312 --- /dev/null +++ b/org.glite.lb.ws-test/examples/ws_status_history_test.sh @@ -0,0 +1,85 @@ +#! /bin/bash + +# +# bug #29165: Times in job status history downloaded from LB are schifted +# +# description: +# Test compares returned history from: +# - official job status example (C API) +# - WS call (gsoap) +# - WS XML response message (gsoap) +# +# requirements: +# - stage area, default `pwd` +# - built WS LB server examples +# - gsoap-plugin in stage built with 'make DEBUG="-DDEBUG"' +# - running LB server, LB locallogger, and LB interlogger +# - proxy certificate for logging and querying +# + +STAGE_LOCATION=${STAGE_LOCATION:-`pwd`} +WS_EXAMPLES_LOCATION=${WS_EXAMPLES_LOCATION:-$STAGE_LOCATION/../org.glite.lb.server/build} +LBSERVER=${LBSERVER:-`hostname -f`:9000} +LBLOGGER=${LBLOGGER:-`hostname -f`:9002} + +script=$(EDG_WL_LOG_DESTINATION=$LBLOGGER $STAGE_LOCATION/examples/glite-lb-submitted.sh -m $LBSERVER 2>log | tail -n 1) +eval $script +test -z "$EDG_JOBID" && exit 2 + +echo "jobid: $EDG_JOBID" +EDG_WL_LOG_DESTINATION=$LBLOGGER $STAGE_LOCATION/examples/glite-lb-waiting.sh -j $EDG_JOBID 2>>log|| exit 3 +sleep 1 +EDG_WL_LOG_DESTINATION=$LBLOGGER $STAGE_LOCATION/examples/glite-lb-ready.sh -j $EDG_JOBID 2>>log|| exit 4 +sleep 1 +EDG_WL_LOG_DESTINATION=$LBLOGGER $STAGE_LOCATION/examples/glite-lb-done.sh -j $EDG_JOBID 2>>log|| exit 5 +sleep 1 +EDG_WL_LOG_DESTINATION=$LBLOGGER $STAGE_LOCATION/examples/glite-lb-cleared.sh -j $EDG_JOBID 2>>log|| exit 6 +sleep 1 +rm -f log + +# C API +status="`TZ=C $STAGE_LOCATION/examples/glite-lb-job_status $EDG_JOBID`" +if test x$(echo "$status" | grep '^state[ :]' | sed -e 's/^.*:[ ]*\(.*\)/\1/') != xCleared; then + echo "ERROR: Expected Cleared status of $EDG_JOBID" + exit 7 +fi +echo "$status" | grep '^stateEnterTimes[ :]' -A 12 > hist-c.txt + +# WS call result +rm -f RECV.log SENT.log TEST.log +TZ=C $WS_EXAMPLES_LOCATION/ws_jobstat -j $EDG_JOBID | grep stateEnterTimes -A 12 > hist-ws.txt +diff -u hist-c.txt hist-ws.txt +ret1=$? +if [ "$ret1" != "0" ]; then + echo "FAILED: WS and C API results differs" +fi + +# WS XML message +if [ ! -s "RECV.log" ]; then + echo "WARNING: RECV.log not found, WS/XML not compared" + exit $ret1 +fi +echo "stateEnterTimes : " > hist-ws-recv.txt +echo " Undefined - not available -" >> hist-ws-recv.txt +grep '^[ \t]*<' RECV.log | xmllint --format - | grep -A3 '' | grep '\|' | tr '\n' ' ' | sed -e 's/<\/time>/<\/time>\n/g' | while read statexml timexml; do + state=`echo $statexml | tr '\n' ' ' | sed -e 's/.*\(.*\)<\/state>.*/\1/'` + time=`echo $timexml | tr '\n' ' ' | sed -e 's/.*