aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/rcutorture/bin/torture.sh
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2020-11-26 13:29:24 -0800
committerPaul E. McKenney <paulmck@kernel.org>2021-01-06 17:03:44 -0800
commitc679d90b21b76319b4a6c719442b6a1ff124b88d (patch)
tree91cffe4c14e006f773cdb7fe5eaedfa7f2aca6b1 /tools/testing/selftests/rcutorture/bin/torture.sh
parenttorture: Make torture.sh throttle VERBOSE_TOROUT_*() for refscale (diff)
downloadlinux-dev-c679d90b21b76319b4a6c719442b6a1ff124b88d.tar.xz
linux-dev-c679d90b21b76319b4a6c719442b6a1ff124b88d.zip
torture: Make torture.sh refuse to do zero-length runs
This commit causes torture.sh to check for zero-length runs and to take the cowardly option of refusing to run them, logging its cowardice for later inspection. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/testing/selftests/rcutorture/bin/torture.sh')
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/torture.sh25
1 files changed, 19 insertions, 6 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/torture.sh b/tools/testing/selftests/rcutorture/bin/torture.sh
index f2f91407fa02..43ef2c0d47c1 100755
--- a/tools/testing/selftests/rcutorture/bin/torture.sh
+++ b/tools/testing/selftests/rcutorture/bin/torture.sh
@@ -151,16 +151,29 @@ do
shift
done
-duration_rcutorture=$((duration_base*duration_rcutorture_frac/10))
-# Need to sum remaining weights, and if duration weights to zero,
-# set do_no_rcutorture. @@@
-duration_locktorture=$((duration_base*duration_locktorture_frac/10))
-duration_scftorture=$((duration_base*duration_scftorture_frac/10))
-
T=/tmp/torture.sh.$$
trap 'rm -rf $T' 0 2
mkdir $T
+duration_rcutorture=$((duration_base*duration_rcutorture_frac/10))
+if test "$duration_rcutorture" -eq 0
+then
+ echo " --- Zero time for rcutorture, disabling" | tee -a $T/log
+ do_rcutorture=no
+fi
+duration_locktorture=$((duration_base*duration_locktorture_frac/10))
+if test "$duration_locktorture" -eq 0
+then
+ echo " --- Zero time for locktorture, disabling" | tee -a $T/log
+ do_locktorture=no
+fi
+duration_scftorture=$((duration_base*duration_scftorture_frac/10))
+if test "$duration_scftorture" -eq 0
+then
+ echo " --- Zero time for scftorture, disabling" | tee -a $T/log
+ do_scftorture=no
+fi
+
touch $T/failures
touch $T/successes