diff options
Diffstat (limited to 'bin/runtest')
-rwxr-xr-x | bin/runtest | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/bin/runtest b/bin/runtest index 34386e4..4356db3 100755 --- a/bin/runtest +++ b/bin/runtest @@ -419,6 +419,34 @@ RUNSNAPTEST() fi } +TIMELIMIT_PARSE() +{ + # Function returns timeparam for timekeeper via standard out - + # any debug statements should be 'echo "Debug string" >&2' or timekeeper + # will declare timeparam to be non-numeric and ignore it. + while read x y ; do + # Scan for entry for this weekday. + xd=`echo $x | cut -f1 -d/` + if [ "$xd" = ${WEEKDAY} ]; then + # strip away the weekday/ part. + timeparam=`echo $x | cut -f2 -d/` + break + fi + case "$x" in + '' | '#'*) + # blank or comment lines. Continue. + ;; + ???/*) + # Ignore any entry not of this weekday. + ;; + *) + timeparam="$x" + ;; + esac + done + echo $timeparam + return +} # configuration parsing. # Taking configuration from input. @@ -561,7 +589,7 @@ errcode=0 # error code of the whole test skiptest=no # if test is skipped CC_SAVED="$CC" # CC & PATH maybe changed within a test. PATH_SAVED=$PATH # These save the original values. -timelimit=300 # time limit (minutes) for the timekeeper +timelimit=300 # default time limit (minutes) for the timekeeper ################################# # Parse options @@ -847,7 +875,7 @@ if [ -n "$TESTHOST" -a $HOSTNAME != "$TESTHOST" ]; then cd ${SNAPYARD}/log # Fork off timekeeper if concurrent tests will be used. if [ -n "$SRCDIR" ]; then - timelimit=`grep -v '^#' $TIMELIMIT` + timelimit=`TIMELIMIT_PARSE < $TIMELIMIT` ($SNAPYARD/current/bin/timekeeper $timelimit > $TIMEKEEPERLOG 2>&1 &) PRINT " Fork off timekeeper $timelimit" fi @@ -872,10 +900,10 @@ if [ -n "$TESTHOST" -a $HOSTNAME != "$TESTHOST" ]; then # launch concurrent tests only if srcdir is used if [ -n "$SRCDIR" ]; then - $CMD & + $CMD || REPORT_ERR "****FAILED ${h}: Abnormal exit from runtest****" && PRINT_BLANK & echo $! > PID.${h}_${CONFIGNAME} else - $CMD + $CMD || REPORT_ERR "****FAILED ${h}: Abnormal exit from runtest****" && PRINT_BLANK fi ;; NoRemoteCommand) @@ -899,7 +927,7 @@ if [ -n "$TESTHOST" -a $HOSTNAME != "$TESTHOST" ]; then TMP_OUTPUT="#${h}_${CONFIGNAME}.out" cat $TMP_OUTPUT # Verify test script did complete by checking the last lines - (tail -2 $TMP_OUTPUT | grep -s 'Grand total' > /dev/null 2>&1) || + (tail -5 $TMP_OUTPUT | grep -s 'Grand total' > /dev/null 2>&1) || (REPORT_ERR "****FAILED ${h}: snaptest did not complete****" && PRINT_BLANK) rm -f $TMP_OUTPUT PID.${h}_${CONFIGNAME} |