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 <[email protected]>
---
 tests/ovn-macros.at | 10 +++++-----
 tests/ovs-macros.at |  8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at
index 105ad0ab7f7f..44c0e20cfdc5 100644
--- a/tests/ovn-macros.at
+++ b/tests/ovn-macros.at
@@ -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"
     ], [
diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at
index 843811d8c972..7e9e8c034041 100644
--- a/tests/ovs-macros.at
+++ b/tests/ovs-macros.at
@@ -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([:])
 }
-- 
2.26.2

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to