torture: Simplify exit-code plumbing for kvm-recheck.sh and kvm-find-errors.sh
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 21 Dec 2020 00:52:29 +0000 (16:52 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 4 Jan 2021 22:01:24 +0000 (14:01 -0800)
This commit simplifies exit-code plumbing.  It makes kvm-recheck.sh return
the value 1 for a build error and 2 for a runtime error.  It also makes
kvm-find-errors.sh avoid checking runtime files for --build-only runs.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/testing/selftests/rcutorture/bin/kvm-find-errors.sh
tools/testing/selftests/rcutorture/bin/kvm-recheck.sh

index be265987fa9d930f59f007d81c0a281292b9a0d3..0670841122d8a0fc9feb74e1534b2fd03dc21cef 100755 (executable)
@@ -46,6 +46,7 @@ fi
 if grep -q -e "--buildonly" < ${rundir}/log
 then
        echo Build-only run, no console logs to check.
+       exit $editorret
 fi
 
 # Find console logs with errors
index 840a4679a0d78ba4e8175dec5e9ff47cfe445cb2..47cf4db10896cacdfcf2265e01a327082e57476c 100755 (executable)
@@ -87,15 +87,16 @@ do
        fi
 done
 EDITOR=echo kvm-find-errors.sh "${@: -1}" > $T 2>&1
-ret=$?
 builderrors="`tr ' ' '\012' < $T | grep -c '/Make.out.diags'`"
 if test "$builderrors" -gt 0
 then
        echo $builderrors runs with build errors.
+       ret=1
 fi
 runerrors="`tr ' ' '\012' < $T | grep -c '/console.log.diags'`"
 if test "$runerrors" -gt 0
 then
        echo $runerrors runs with runtime errors.
+       ret=2
 fi
 exit $ret