From 055120e8b74a94ea244095efc6f026e2d8665d42 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Tue, 19 Jan 2010 14:40:39 +0000 Subject: [PATCH] Fixes: - number of offspring check - reaction on error checking status Better output. --- org.glite.testsuites.ctb/LB/tests/lb-test-wild.sh | 25 ++++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) 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 f871804..41a033f 100755 --- a/org.glite.testsuites.ctb/LB/tests/lb-test-wild.sh +++ b/org.glite.testsuites.ctb/LB/tests/lb-test-wild.sh @@ -275,7 +275,7 @@ EOF function check_status() { prev_status=${stats[$1]} jobid=${jobs[$1]} - glite-wms-job-status -v 0 $jobid >stat.log || fail 2 "Can't get job status" + glite-wms-job-status -v 0 $jobid >stat.log || fatal 2 "Can't get job status" status=`cat stat.log | $SYS_GREP '^Current Status: ' | $SYS_SED -e 's/^Current Status: [ \t]*\([a-zA-Z]*\).*/\1/'` if [ x"$status" != x"$prev_status" ]; then date '+%Y-%m-%d %H:%M:%S' >> log @@ -310,6 +310,7 @@ fail=$TEST_OK # -- launch the beast -- +touch $$.err { test_start @@ -348,7 +349,7 @@ while test $quit -eq 0; do quit=1 for ((i=0;i 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 | uniq | tr '\n' ' ' | $SYS_SED 's/ $//'` + 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 expected_status='' @@ -413,7 +414,7 @@ for ((i=0;i subjobs.log - if test x"`wc -l subjobs.log`" != x"5"; then - test_failed && print_error "error, some offspring of $jobid were spawned or eaten!" + if test x"`wc -l subjobs.log | $SYS_SED 's/\s*\([0-9]*\).*/\1/'`" != x"5"; then + print_error "error, some offspring of $jobid were spawned or eaten!" && test_failed fail=$TEST_ERROR fi j=1 @@ -464,7 +465,7 @@ for ((i=0; i<${#job_cats[*]}; i++)); do if test "$?" = "0"; then printf "[wild] output of $j. offspring of $jobid fetched" && test_done else - test_failed && print_error "can't fetch output from $subjobid!" + print_error "can't fetch output from $subjobid!" && test_failed fail=$TEST_ERROR fi j=$((j+1)) @@ -487,12 +488,12 @@ while test $quit -eq 0; do check_status $i case "$status" in 'Cleared') - quit=0 ;; - 'Cancelled'|'Aborted') + 'Cancelled'|'Aborted'|'Purged') cleared_fail=1 ;; *) + quit=0 ;; esac fi @@ -502,7 +503,7 @@ done if test x"$cleared_fail" = x"0"; then printf "[wild] all jobs in done cleared" && test_done else - test_failed && print_error "not all expected jobs in cleared state" + print_error "not all expected jobs in cleared state!" && test_failed fail=$TEST_ERROR fi -- 1.8.2.3