+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
+}
+
+if test "$IS_WIN32" = "yes"; then
+ pwd () {
+ command pwd -W "$@"
+ }
+
+ diff () {
+ command diff --strip-trailing-cr "$@"
+ }
+
+ kill () {
+ case "$1" in
+ -0)
+ shift
+ for i in $*; do
+ # tasklist will always have return code 0.
+ # If pid does exist, there will be a line with the pid.
+ if tasklist //fi "PID eq $i" | grep $i; then
+ :
+ else
+ return 1
+ fi
+ done
+ return 0
+ ;;
+ -[1-9]*)
+ shift
+ for i in $*; do
+ taskkill //F //PID $i
+ done
+ ;;
+ [1-9][1-9]*)
+ for i in $*; do
+ taskkill //F //PID $i
+ done
+ ;;
+ esac
+ }
+fi
+]
+m4_divert_pop([PREPARE_TESTS])
+