[ovs-dev] [PATCH 6/9] tests: New macro OVS_WAIT_WHILE.

Ben Pfaff blp at nicira.com
Fri Jan 15 21:09:42 UTC 2010


For use by upcoming tests.
---
 tests/ovsdb-monitor.at |    2 +-
 tests/testsuite.at     |    7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/ovsdb-monitor.at b/tests/ovsdb-monitor.at
index 47300ea..3192767 100644
--- a/tests/ovsdb-monitor.at
+++ b/tests/ovsdb-monitor.at
@@ -32,7 +32,7 @@ m4_define([OVSDB_CHECK_MONITOR],
    OVS_CHECK_LCOV([ovsdb-client transact unix:socket '[[]]'], [0],
                   [ignore], [ignore], [kill `cat server-pid client-pid`])
    AT_CHECK([ovs-appctl -t $PWD/unixctl -e exit], [0], [ignore], [ignore])
-   OVS_WAIT_UNTIL([test ! -e server-pid && test ! -e client-pid && exit 0])
+   OVS_WAIT_UNTIL([test ! -e server-pid && test ! -e client-pid])
    AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$6], [ignore])
    AT_CLEANUP])
 
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 4117f20..6ec1a80 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -18,7 +18,7 @@ AT_TESTED([ovs-vswitchd])
 AT_TESTED([ovs-vsctl])
 AT_TESTED([perl])
 
-m4_define([OVS_WAIT_UNTIL],
+m4_define([OVS_WAIT],
   [AT_CHECK(
     [# First try a quick sleep, so that the test completes very quickly
      # in the normal case.  POSIX doesn't require fractional times to
@@ -30,7 +30,10 @@ m4_define([OVS_WAIT_UNTIL],
        sleep 1
        $1
      done
-     exit 1], [0], [ignore], [ignore])])
+     exit 1], [0], [ignore], [ignore], [$2])])
+
+m4_define([OVS_WAIT_UNTIL], [OVS_WAIT([if $1; then exit 0; fi], [$2])])
+m4_define([OVS_WAIT_WHILE], [OVS_WAIT([if $1; then :; else exit 0; fi], [$2])])
 
 m4_include([tests/ovsdb-macros.at])
 m4_include([tests/lcov-pre.at])
-- 
1.6.3.3





More information about the dev mailing list