Update paths, harvester test script fixes.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Fri, 25 Mar 2011 16:06:33 +0000 (16:06 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Fri, 25 Mar 2011 16:06:33 +0000 (16:06 +0000)
org.glite.testsuites.ctb/LB/tests/lb-common.sh
org.glite.testsuites.ctb/LB/tests/lb-test-harvester.sh
org.glite.testsuites.ctb/LB/tests/lb-test-wild.sh

index a80a916..ecc088a 100755 (executable)
@@ -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
index b73a661..4993dd1 100755 (executable)
@@ -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 "</pre>"
 fi
 
-if [ $err = 0 ]; then
+if [ "$err" = "0" ]; then
        test_done
 else
        test_failed
index 2d96120..63308f0 100755 (executable)
@@ -361,7 +361,7 @@ for ((i=0;i<n;i++)); do
        jobid="${jobs[$i]}"
        status="${stats[$i]}"
 
-       $GLITE_LOCATION/examples/glite-lb-job_log "$jobid" > $$.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