mirror of
https://github.com/linux-msm/bootrr.git
synced 2026-02-25 13:12:03 -08:00
helpers/bootrr: move timeout to separate helper
There is no need to have timeout as a function in the bootrr file. Move it to a separate helper file as we have for the rest of helpers. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
This commit is contained in:
committed by
Bjorn Andersson
parent
d2329902b7
commit
dad8a13e9e
@@ -1,18 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
timeout() {
|
||||
attempts="$1"; shift
|
||||
cmd="$@"
|
||||
|
||||
for i in `seq ${attempts}`
|
||||
do
|
||||
$cmd && return 0
|
||||
sleep 1
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
test_report_exit() {
|
||||
TEST_RESULT=$1
|
||||
command -v lava-test-case
|
||||
|
||||
17
helpers/timeout
Executable file
17
helpers/timeout
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Usage: $0 <seconds> <command> <args>...."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
attempts="$1"; shift
|
||||
cmd="$@"
|
||||
|
||||
for i in `seq ${attempts}`
|
||||
do
|
||||
$cmd && exit 0
|
||||
sleep 1
|
||||
done
|
||||
|
||||
exit 1
|
||||
Reference in New Issue
Block a user