diff options
author | Linus Nordberg <linus@nordu.net> | 2016-11-25 23:50:37 +0100 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2016-11-25 23:50:37 +0100 |
commit | c070573e5cc6bc21653ebb82d8f64b7ef44ae9ef (patch) | |
tree | 75d855e348cba5f11c0032eee93743c0ceab08df /test/scripts/testutils.sh | |
parent | ab0550f8f0c8f544b5878746ea963180551192d7 (diff) |
Sleep less in tests.
Diffstat (limited to 'test/scripts/testutils.sh')
-rw-r--r-- | test/scripts/testutils.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/scripts/testutils.sh b/test/scripts/testutils.sh index d264464..faa7026 100644 --- a/test/scripts/testutils.sh +++ b/test/scripts/testutils.sh @@ -9,6 +9,16 @@ assert_equal() { test "$2" = "$3" || fail "$1 $2 != expected $3" } +wait_for_equal() { + n=$4 + while [ $n -gt 0 ]; do + [ $(eval "$2") = "$3" ] && return + n=$((n-1)) + sleep 1 + done + assert_equal "$1" "$(eval "$2")" "$3" +} + get_treesize() { ${top_srcdir}/tools/loginfo.py --config ${top_srcdir}/test/catlfish-test.cfg --localconfig ${top_srcdir}/test/catlfish-test-local-merge.cfg --treesize https://localhost:8080/ } |