diff --git a/helpers/bootrr b/helpers/bootrr index eea482e..f576854 100644 --- a/helpers/bootrr +++ b/helpers/bootrr @@ -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 diff --git a/helpers/timeout b/helpers/timeout new file mode 100755 index 0000000..e713cd6 --- /dev/null +++ b/helpers/timeout @@ -0,0 +1,17 @@ +#!/bin/sh + +if [ $# -lt 2 ]; then + echo "Usage: $0 ...." + exit 1 +fi + +attempts="$1"; shift +cmd="$@" + +for i in `seq ${attempts}` +do + $cmd && exit 0 + sleep 1 +done + +exit 1