testcases/lib/test.sh: add tst_retry()

The function allows you to retry running command a few times until it
succeeds or until given amount of retries has been reached.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
2 files changed