Skip to content

Commit cd1955d

Browse files
committed
torture: Make kvm-recheck.sh report .config errors
Currently, kvm-recheck.sh will print out any .config errors with messages of the form: :CONFIG_TASKS_TRACE_RCU=y: improperly set However, if these are the only errors, the resulting exit code will declare the run successful. This commit therefore causes kvm-recheck.sh to record .config errors in the results directory in a file named ConfigFragment.diags and also returns a non-zero error code in that case. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 5cec64e commit cd1955d

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

tools/testing/selftests/rcutorture/bin/kvm-recheck.sh

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
T=/tmp/kvm-recheck.sh.$$
1717
trap 'rm -f $T' 0 2
1818

19+
configerrors=0
20+
1921
PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH
2022
. functions.sh
2123
for rd in "$@"
@@ -32,7 +34,7 @@ do
3234
fi
3335
TORTURE_SUITE="`cat $i/../torture_suite`" ; export TORTURE_SUITE
3436
configfile=`echo $i | sed -e 's,^.*/,,'`
35-
rm -f $i/console.log.*.diags
37+
rm -f $i/console.log.*.diags $i/ConfigFragment.diags
3638
case "${TORTURE_SUITE}" in
3739
X*)
3840
;;
@@ -49,8 +51,14 @@ do
4951
then
5052
echo QEMU killed
5153
fi
52-
configcheck.sh $i/.config $i/ConfigFragment > $T 2>&1
53-
cat $T
54+
configcheck.sh $i/.config $i/ConfigFragment > $i/ConfigFragment.diags 2>&1
55+
if test -s $i/ConfigFragment.diags
56+
then
57+
cat $i/ConfigFragment.diags
58+
configerrors=$((configerrors+1))
59+
else
60+
rm $i/ConfigFragment.diags
61+
fi
5462
if test -r $i/Make.oldconfig.err
5563
then
5664
cat $i/Make.oldconfig.err
@@ -65,7 +73,14 @@ do
6573
if test -f "$i/buildonly"
6674
then
6775
echo Build-only run, no boot/test
68-
configcheck.sh $i/.config $i/ConfigFragment
76+
configcheck.sh $i/.config $i/ConfigFragment > $i/ConfigFragment.diags 2>&1
77+
if test -s $i/ConfigFragment.diags
78+
then
79+
cat $i/ConfigFragment.diags
80+
configerrors=$((configerrors+1))
81+
else
82+
rm $i/ConfigFragment.diags
83+
fi
6984
parse-build.sh $i/Make.out $configfile
7085
elif test -f "$i/qemu-cmd"
7186
then
@@ -79,10 +94,10 @@ do
7994
done
8095
if test -f "$rd/kcsan.sum"
8196
then
82-
if ! test -f $T
97+
if ! test -f $i/ConfigFragment.diags
8398
then
8499
:
85-
elif grep -q CONFIG_KCSAN=y $T
100+
elif grep -q CONFIG_KCSAN=y $i/ConfigFragment.diags
86101
then
87102
echo "Compiler or architecture does not support KCSAN!"
88103
echo Did you forget to switch your compiler with '--kmake-arg CC=<cc-that-supports-kcsan>'?
@@ -94,17 +109,23 @@ do
94109
fi
95110
fi
96111
done
112+
113+
if test "$configerrors" -gt 0
114+
then
115+
echo $configerrors runs with .config errors.
116+
ret=1
117+
fi
97118
EDITOR=echo kvm-find-errors.sh "${@: -1}" > $T 2>&1
98119
builderrors="`tr ' ' '\012' < $T | grep -c '/Make.out.diags'`"
99120
if test "$builderrors" -gt 0
100121
then
101122
echo $builderrors runs with build errors.
102-
ret=1
123+
ret=2
103124
fi
104125
runerrors="`tr ' ' '\012' < $T | grep -c '/console.log.diags'`"
105126
if test "$runerrors" -gt 0
106127
then
107128
echo $runerrors runs with runtime errors.
108-
ret=2
129+
ret=3
109130
fi
110131
exit $ret

0 commit comments

Comments
 (0)