From 49c82e10cc85a694b06a665b0f1824e2384dcb9a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Fri, 25 Mar 2011 16:06:33 +0000 Subject: [PATCH] Update paths, harvester test script fixes. --- org.glite.testsuites.ctb/LB/tests/lb-common.sh | 13 +++++------ .../LB/tests/lb-test-harvester.sh | 25 +++++++++++----------- org.glite.testsuites.ctb/LB/tests/lb-test-wild.sh | 2 +- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/org.glite.testsuites.ctb/LB/tests/lb-common.sh b/org.glite.testsuites.ctb/LB/tests/lb-common.sh index a80a916..ecc088a 100755 --- a/org.glite.testsuites.ctb/LB/tests/lb-common.sh +++ b/org.glite.testsuites.ctb/LB/tests/lb-common.sh @@ -35,16 +35,13 @@ source ${TEST_COMMON} ulimit -c unlimited # define variables -GLITE_LB_LOCATION=${GLITE_LB_LOCATION:-/opt/glite} -GLITE_LOCATION=${GLITE_LB_LOCATION} +GLITE_LB_LOCATION=${GLITE_LB_LOCATION:-$GLITE_LOCATION} +GLITE_LOCATION=${GLITE_LOCATION:-'/opt/glite'} SAME_SENSOR_HOME=${SAME_SENSOR_HOME:-.} -PATH=$GLITE_LOCATION/bin:$GLITE_LOCATION/examples:$PATH -for libdir in lib lib64; do - examples="$GLITE_LOCATION/$libdir/glite-lb/examples" - if test -d "$examples"; then - PATH="$examples:$PATH" - fi +for dir in $GLITE_LOCATION $GLITE_LOCATION/lib64/glite-lb $GLITE_LOCATION/lib/glite-lb; do + if test -d "$dir/examples"; then PATH="$examples:$PATH"; fi done +PATH="$GLITE_LOCATION/bin:$PATH" export PATH # LB binaries diff --git a/org.glite.testsuites.ctb/LB/tests/lb-test-harvester.sh b/org.glite.testsuites.ctb/LB/tests/lb-test-harvester.sh index b73a661..4993dd1 100755 --- a/org.glite.testsuites.ctb/LB/tests/lb-test-harvester.sh +++ b/org.glite.testsuites.ctb/LB/tests/lb-test-harvester.sh @@ -33,7 +33,7 @@ Prerequisities: GLITE_RTM_TEST_ADDITIONAL_ARGS ... L&B harvester additional arguments (--old required for L&B < 2.0) - For full list of the possible environment variables, see '\$GLITE_LOCATION/examples/glite-lb-harvester.sh --help'. + For full list of the possible environment variables, see '`which glite-lb-harvester.sh` --help'. Tests called (glite-lb-harvester.sh script): @@ -174,18 +174,19 @@ else test_skipped fi +printf "L&B harvester test script in PATH" +if which glite-lb-harvester-test.sh >/dev/null 2>&1; then + test_done +else + test_failed + print_error "glite-lb-harvester-test.sh not found" + exit 2 +fi ## # ==== L&B harvester test ==== ## -rm -f 'test.sql' -if [ -f "$GLITE_LOCATION/etc/glite-lb/harvester-test-dbsetup.sql" ]; then - ln -s "$GLITE_LOCATION/etc/glite-lb/harvester-test-dbsetup.sql" 'test.sql' -else - wget --quiet -O 'test.sql' 'http://jra1mw.cvs.cern.ch/cgi-bin/jra1mw.cgi/org.glite.lb.harvester/examples/test.sql?revision=HEAD' -fi - printf "Launching the L&B harvester test..." print_newline if [ -n "$is_html" ]; then @@ -194,14 +195,14 @@ if [ -n "$is_html" ]; then else local_amp='&' fi -$GLITE_LOCATION/examples/glite-lb-harvester-test.sh stop -$GLITE_LOCATION/examples/glite-lb-harvester-test.sh 2>&1 | sed "s,&,$local_amp," -err=$? +glite-lb-harvester-test.sh stop +(glite-lb-harvester-test.sh 2>&1; echo $? > res.$$.txt) | sed "s,&,$local_amp," +err=`cat res.$$.txt`; rm -f res.$$.txt if [ -n "$is_html" ]; then printf "" fi -if [ $err = 0 ]; then +if [ "$err" = "0" ]; then test_done else test_failed diff --git a/org.glite.testsuites.ctb/LB/tests/lb-test-wild.sh b/org.glite.testsuites.ctb/LB/tests/lb-test-wild.sh index 2d96120..63308f0 100755 --- a/org.glite.testsuites.ctb/LB/tests/lb-test-wild.sh +++ b/org.glite.testsuites.ctb/LB/tests/lb-test-wild.sh @@ -361,7 +361,7 @@ for ((i=0;i $$.ulm.log || fatal $TEST_ERROR "Can't query events for '$jobid'" + glite-lb-job_log "$jobid" > $$.ulm.log || fatal $TEST_ERROR "Can't query events for '$jobid'" components=`cat $$.ulm.log | head -n -1 | $SYS_GREP -v '^$' | $SYS_SED -e 's/.*DG\.SOURCE="\([^"]*\)".*/\1/' | sort -f | uniq | tr '\n' ' ' | $SYS_SED 's/ $//'` rm -f $$.ulm.log -- 1.8.2.3