mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-22 02:37:15 +00:00
stress2: Add an option to exit on error
This commit is contained in:
parent
02a2005a5a
commit
219d8fb036
|
@ -42,14 +42,15 @@ alloutput=$sdir/output # Output from current test
|
|||
allexcess=$sdir/excessive # Tests with excessive runtime
|
||||
allelapsed=$sdir/elapsed # Test runtime
|
||||
alllocal=$sdir/all.exclude # Local exclude list
|
||||
exitonerror=0 # -e option
|
||||
loops=0 # Times to run the tests
|
||||
# Get kernel config + revision
|
||||
rev=`uname -a | awk '{print $7}' | sed 's/://'`
|
||||
rev="`uname -a | sed 's#.*/compile/##; s/ .*//'` $rev"
|
||||
|
||||
args=`getopt acl:m:no "$@"`
|
||||
args=`getopt acel:m:no "$@"`
|
||||
[ $? -ne 0 ] &&
|
||||
echo "Usage $0 [-a] [-c] [-l <val>] [-m <min.>] [-n] [-o] [<tests>]" &&
|
||||
echo "Usage $0 [-a] [-c] [-e] [-l <val>] [-m <min.>] [-n] [-o] [<tests>]" &&
|
||||
exit 1
|
||||
set -- $args
|
||||
for i; do
|
||||
|
@ -62,6 +63,9 @@ for i; do
|
|||
rm -f $alllist
|
||||
shift
|
||||
;;
|
||||
-e) exitonerror=1
|
||||
shift
|
||||
;;
|
||||
-l) loops=$2 # Number of time to run
|
||||
shift; shift
|
||||
;;
|
||||
|
@ -160,6 +164,7 @@ trap intr INT
|
|||
|
||||
[ -f all.debug.inc ] && . all.debug.inc
|
||||
s1=`date +%s`
|
||||
touch $sdir/starttime
|
||||
while true; do
|
||||
exclude=`cat all.exclude $alllocal 2>/dev/null | sed '/^#/d' |
|
||||
grep "^[a-zA-Z].*\.sh" | awk '{print $1}'`
|
||||
|
@ -226,6 +231,7 @@ while true; do
|
|||
[ $e -ne 0 ] &&
|
||||
echo "FAIL $i exit code $e"
|
||||
) 2>&1 | tee $alloutput
|
||||
grep -qw FAIL $alloutput && e=1 || e=0
|
||||
ts=`date '+%Y%m%d %T'`
|
||||
grep -qw FAIL $alloutput &&
|
||||
echo "$ts $rev $i" >> $allfaillog &&
|
||||
|
@ -247,6 +253,7 @@ while true; do
|
|||
[ $all_debug ] && post_debug
|
||||
[ $minutes ] && [ $((`date +%s` - s1)) -ge $minutes ] &&
|
||||
break 2
|
||||
[ $exitonerror -eq 1 -a $e -ne 0 ] && break 2
|
||||
done
|
||||
[ $((loops -= 1)) -eq 0 ] && break
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue