@@ -373,10 +373,10 @@ check_row_count() {
wait_row_count() {
local db=$(parse_db $1) table=$(parse_table $1); shift
local count=$1; shift
- local a=$1 b=$2 c=$3
+ local a=$1 b=$2 c=$3 d=$4 e=$5
echo "Waiting until $count rows in $db $table${1+ with $*}..."
- OVS_WAIT_UNTIL([test $count = $(count_rows $db:$table $a $b $c)],[
- echo "$db table $table has the following rows. $(count_rows $db:$table $a $b $c) rows match instead of expected $count:"
+ OVS_WAIT_UNTIL([test $count = $(count_rows $db:$table $a $b $c $d $e)],[
+ echo "$db table $table has the following rows. $(count_rows $db:$table $a $b $c $d $e) rows match instead of expected $count:"
ovn-${db}ctl list $table])
}
@@ -425,12 +425,12 @@ check_column() {
wait_column() {
local expected=$(for d in $1; do echo $d; done | sort)
local db=$(parse_db $2) table=$(parse_table $2) column=${3-_uuid}; shift; shift; shift
- local a=$1 b=$2 c=$3
+ local a=$1 b=$2 c=$3 d=$4 e=$5
echo
echo "Waiting until $column in $db $table${1+ with $*} is $expected..."
OVS_WAIT_UNTIL([
- found=$(ovn-${db}ctl --bare --columns $column find $table $a $b $c)
+ found=$(ovn-${db}ctl --bare --columns $column find $table $a $b $c $d $e)
found=$(for d in $found; do echo $d; done | sort)
test "$expected" = "$found"
], [
@@ -217,13 +217,13 @@ ovs_wait () {
if ovs_wait_cond; then echo "$1: wait succeeded quickly" >&AS_MESSAGE_LOG_FD; return 0; fi
# Then wait up to OVS_CTL_TIMEOUT seconds.
- local d
- for d in `seq 1 "$OVS_CTL_TIMEOUT"`; do
+ local timer
+ for timer in `seq 1 "$OVS_CTL_TIMEOUT"`; do
sleep 1
- if ovs_wait_cond; then echo "$1: wait succeeded after $d seconds" >&AS_MESSAGE_LOG_FD; return 0; fi
+ if ovs_wait_cond; then echo "$1: wait succeeded after $timer seconds" >&AS_MESSAGE_LOG_FD; return 0; fi
done
- echo "$1: wait failed after $d seconds" >&AS_MESSAGE_LOG_FD
+ echo "$1: wait failed after $timer seconds" >&AS_MESSAGE_LOG_FD
ovs_wait_failed
AT_FAIL_IF([:])
}
These only supported three condition arguments but an upcoming patch wants more. I had to rename $d in ovs_wait() because shell isn't very good about variable name scoping. Signed-off-by: Ben Pfaff <blp@ovn.org> --- tests/ovn-macros.at | 10 +++++----- tests/ovs-macros.at | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-)