git: 219d8fb0361f - main - stress2: Add an option to exit on error
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 16 Apr 2024 08:22:31 UTC
The branch main has been updated by pho:
URL: https://cgit.FreeBSD.org/src/commit/?id=219d8fb0361f459ab458f17fe58da32ea00c0104
commit 219d8fb0361f459ab458f17fe58da32ea00c0104
Author: Peter Holm <pho@FreeBSD.org>
AuthorDate: 2024-04-16 08:22:03 +0000
Commit: Peter Holm <pho@FreeBSD.org>
CommitDate: 2024-04-16 08:22:03 +0000
stress2: Add an option to exit on error
---
tools/test/stress2/misc/all.sh | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/tools/test/stress2/misc/all.sh b/tools/test/stress2/misc/all.sh
index 605c9958b552..86d986099dbb 100755
--- a/tools/test/stress2/misc/all.sh
+++ b/tools/test/stress2/misc/all.sh
@@ -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