random-sleep: add possiblity to override via environment variable
authorMichael Adam <obnox@samba.org>
Wed, 13 Nov 2013 13:53:45 +0000 (14:53 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 13 Nov 2013 13:53:45 +0000 (14:53 +0100)
set AUTOBUILD_RANDOM_SLEEP_OVERRIDE=<x>

to the number x of seconds that you want to sleep.
This is added to make it possible to run one autobuild
target without having to wait for several minutes.

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
script/random-sleep.sh

index 9bb866b3e09a2d5af3c06ce46eec03be614b575d..6d79ffbf2998089cfb7188cbef493bb78fc0c62f 100755 (executable)
@@ -16,6 +16,10 @@ r=$(head --bytes=2 /dev/urandom | od -l | head -n 1 | sed -e 's/^[^ ]*  *//')
 v=$(expr $r % $s)
 d=$(expr $l + $v)
 
+if test "x${AUTOBUILD_RANDOM_SLEEP_OVERRIDE}" != "x" ; then
+       d="${AUTOBUILD_RANDOM_SLEEP_OVERRIDE}"
+fi
+
 echo "$0: sleep $d ... start"
 sleep $d
 echo "$0: sleep $d ... end"