[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [LTP] New README




Well, I have a hacky little driver script I just finished which reads
in command lines from the provided cmdlinds file for doio tests, and
does the ultra-cheesy thing with the tests directory and assumes that
each .c has a corresponding program to run & runs that.

It's just a quick fix to me, but if you think it's a useful starting 
point, please feel free to use this however you like, even if only 
for a good laugh. ;)

-Sean

On Mon, 21 Aug 2000, Aaron Laffin wrote:

]
]I've checked a bit of a README into CVS (attached).  If you have
]additions, send them.
]
]For now, I've gathered from various discussions that functional
]regression testing should be our major goal.  I believe stress testing
]may be a form of testing we will eventually take up.  Many regression
]tests can be run in "stressful" manner by running a number of tests
]concurrently rather than in a sequential manner.
]
]This brings us to the topic of a runtime-driver; something responsible
]for retrieving command lines and running them.  It might also be
]responsible configuration analysis and result reporting.  Configuration
]analysis refers to the runtime-driver being able to report whether a
]test program or even a specific test case within a test program failed. 
]Configuration analysis refers to the drivers ability understand test
]environment requirements and system environment capabilities and run
]only tests that map.  An example of this is to avoid running a bigmem
]test on a 64Mb system.
]
]Does any one else have ideas on this?
]
]--aaron
]
]
#/bin/sh

get_doio_test()
{
    case $1 in

	0)  numtests=`egrep -v '^#|^$' ${ltpdir}/cmdlines  | wc -l`
	    numtests=`expr $numtests + 0` ;;

	*)  cmd="`head -${1} ${ltpdir}/cmdlines | tail -1`" ;;
    esac
}


get_kernel_test()
{
    case $1 in

	0)  numtests=`(cd ${ltpdir}/tests; ls -1 *.c | cut -f1 -d".") | wc -l`
	    numtests=`expr $numtests + 0` ;;

	*)  cmd="`(cd ${ltpdir}/tests; ls -1 *.c | cut -f1 -d".") \
	    | head -${1} | tail -1` -timing -iterations 10" ;;
    esac
}

run_test_group()
{
    tgstat=0
    get_${1}_test 0

    echo "`basename $0`: starting $numtests $tg tests" 

    curtest=1
    while [ "$curtest" -le "$numtests" ]; do
	echo -n "`basename $0`: running $tg test ${curtest}.. "

	get_${1}_test $curtest

	echo "START: ${cmd}" >> $logfile
	eval ${cmd} >> $logfile 2>&1

	if [ "$?" -ne "0" ]; then
	    echo "failed"
	    tgstat=`expr $tgstat + 1`
	    echo "END: FAILED: exit status: $exit" >> $logfile
	else
	    echo "passed"
	    echo "END: PASSED" >> $logfile
	fi

	curtest=`expr $curtest + 1`
    done

    echo "`basename $0`: finished ltp $tg tests: $tgstat failures"
    return $tgstat
}


status=0

ltpdir=`dirname $0`
logfile=${ltpdir}/testlog.txt
export PATH=${ltpdir}/doio:${ltpdir}/tests:$PATH

echo "`basename $0`: starting ltp tests. see $logfile for runtime detail"

if [ "$#" -gt "0" ]; then
	testlist="$*"
else
	testlist="doio kernel"
fi

for tg in $testlist; do
	run_test_group $tg
	status=`expr $status + $?`
done

echo "`basename $0`: finished ltp tests with $status total failures"