torture: Enable torture.sh argument checking
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 25 Nov 2020 00:28:01 +0000 (16:28 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Thu, 7 Jan 2021 01:03:41 +0000 (17:03 -0800)
This commit uncomments the argument checking for the --duration argument
to torture.sh.  While in the area, it also corrects the duration units
from seconds to minutes.

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

index e13dacf258f4d87211103b2c838dfa2d46ddbd75..8e667975f9d2920e3d9ec7e02c05f4e050188a6c 100755 (executable)
@@ -157,17 +157,17 @@ do
                fi
                ;;
        --duration)
-               # checkarg --duration "(minutes)" $# "$2" '^[0-9][0-9]*\(s\|m\|h\|d\|\)$' '^error'
-               mult=60
-               if echo "$2" | grep -q 's$'
+               checkarg --duration "(minutes)" $# "$2" '^[0-9][0-9]*\(m\|h\|d\|\)$' '^error'
+               mult=1
+               if echo "$2" | grep -q 'm$'
                then
                        mult=1
                elif echo "$2" | grep -q 'h$'
                then
-                       mult=3600
+                       mult=60
                elif echo "$2" | grep -q 'd$'
                then
-                       mult=86400
+                       mult=1440
                fi
                ts=`echo $2 | sed -e 's/[smhd]$//'`
                duration_base=$(($ts*mult))