+m4_divert_push([PREPARE_TESTS])
+[
+ovs_wait () {
+ # First try a quick sleep, so that the test completes very quickly
+ # in the normal case. POSIX doesn't require fractional times to
+ # work, so this might not work.
+ sleep 0.1
+ ovs_wait_cond && exit 0
+ # Then wait up to 10 seconds.
+ for d in 0 1 2 3 4 5 6 7 8 9; do
+ sleep 1
+ ovs_wait_cond && exit 0
+ done
+ exit 1
+}
+
+# Prints the integers from $1 to $2, increasing by $3 (default 1) on stdout.
+seq () {
+ while test $1 -le $2; do
+ echo $1
+ set `expr $1 + ${3-1}` $2 $3
+ done
+}
+]
+m4_divert_pop([PREPARE_TESTS])
+