From 6cfa419f9a1b458f12661cff15ac069a038a15e6 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 26 Mar 2003 17:14:35 -0500 Subject: [svn-r6522] Purpose: new feature and some bug fixes Description: Add a new feature to "skip" some tests. Sometimes, a machine has problem (e.g. titan and sleipnir having AFS problems). Sometimes some feature in a machine is temporary off (e.g., PGI compilers in eirene.) The tests will be reported being SKIPPED which will be reminder to remove the skipping once the problem is fixed. I installed the skipping control in snaptest.cfg rather than in allhostsfile to have a finer control to skip just a subset of the tests of a machine, rather than skipping the all tests of a machine. Bug fixes: fixed the miscounting of number of tests ran. It was reporting one too many. Platforms tested: Only tested in eirene since eirene is the one uses it directly. Misc. update: --- bin/runtest | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/bin/runtest b/bin/runtest index 08fa700..c2e1af7 100755 --- a/bin/runtest +++ b/bin/runtest @@ -110,7 +110,11 @@ REPORT_ERR() REPORT_RESULT() { if [ $retcode -eq 0 ]; then - PRINT "PASSED ${HOSTNAME}: $TEST_TYPE" | tee -a $PASSEDLOG + if [ $skiptest = yes ]; then + PRINT "SKIPPED ${HOSTNAME}: $TEST_TYPE" | tee -a $PASSEDLOG + else + PRINT "PASSED ${HOSTNAME}: $TEST_TYPE" | tee -a $PASSEDLOG + fi else # test failed. REPORT_ERR "****FAILED ${HOSTNAME}: $TEST_TYPE****" @@ -253,11 +257,13 @@ RUNSNAPTEST() { SNAPCMD_OPT="$STANDARD_OPT" # snapshot test option SRCDIRNAME="" - CC_SAVED="$CC" - PATH_SAVED=$PATH + # restore CC, PATH in case they were changed in the last test. + CC="$CC_SAVED" + PATH=$PATH_SAVED export PATH # DEC OSF1 needs to export PATH explicitly TEST_TYPE=$* retcode=0 + skiptest=no date PRINT "*** starting $TEST_TYPE tests in $HOSTNAME ***" PRINT "Uname -a: `uname -a`" @@ -302,6 +308,10 @@ RUNSNAPTEST() export $1 shift; shift ;; + skip) + # skip this test + skiptest=yes + ;; *) # unknown test PRINT "$0: unknown type of test ($1)" retcode=1 @@ -309,7 +319,11 @@ RUNSNAPTEST() esac shift done - [ $retcode -ne 0 ] && errcode=$retcode && return $retcode +echo CC=$CC, PATH=$PATH + if [ $retcode -ne 0 -o $skiptest = yes ]; then + errcode=$retcode + return $retcode + fi # Track down the zlib software ans=`$SNAPYARD/current/bin/locate_sw zlib` @@ -342,10 +356,6 @@ RUNSNAPTEST() [ $retcode -ne 0 ] && errcode=$retcode date >> $LOGFILE - - # restore CC, PATH - CC="$CC_SAVED" - PATH=$PATH_SAVED } @@ -372,6 +382,7 @@ RUNSNAPTEST() # op-configure