torture: Enable torture.sh argument checking
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>
This commit is contained in:
parent
69d2b33e3f
commit
532017b119
@ -157,17 +157,17 @@ do
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
--duration)
|
--duration)
|
||||||
# checkarg --duration "(minutes)" $# "$2" '^[0-9][0-9]*\(s\|m\|h\|d\|\)$' '^error'
|
checkarg --duration "(minutes)" $# "$2" '^[0-9][0-9]*\(m\|h\|d\|\)$' '^error'
|
||||||
mult=60
|
mult=1
|
||||||
if echo "$2" | grep -q 's$'
|
if echo "$2" | grep -q 'm$'
|
||||||
then
|
then
|
||||||
mult=1
|
mult=1
|
||||||
elif echo "$2" | grep -q 'h$'
|
elif echo "$2" | grep -q 'h$'
|
||||||
then
|
then
|
||||||
mult=3600
|
mult=60
|
||||||
elif echo "$2" | grep -q 'd$'
|
elif echo "$2" | grep -q 'd$'
|
||||||
then
|
then
|
||||||
mult=86400
|
mult=1440
|
||||||
fi
|
fi
|
||||||
ts=`echo $2 | sed -e 's/[smhd]$//'`
|
ts=`echo $2 | sed -e 's/[smhd]$//'`
|
||||||
duration_base=$(($ts*mult))
|
duration_base=$(($ts*mult))
|
||||||
|
Loading…
Reference in New Issue
Block a user