Thanks for the review. Will push after removing sleep 1 as pointed out by Yamamoto San.
On Tue, Jun 10, 2014 at 11:54 AM, Jarno Rajahalme <jrajaha...@nicira.com> wrote: > > On Jun 9, 2014, at 9:33 AM, Andy Zhou <az...@nicira.com> wrote: > >> Add a macro to waiting until all ports supplied are connected. >> >> CC: Jarno Rajahalme <jrajaha...@nicira.com> >> Signed-off-by: Andy Zhou <az...@nicira.com> >> --- >> tests/ofproto-macros.at | 9 +++++++++ >> 1 file changed, 9 insertions(+) >> >> diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at >> index b4b6dab..af1e4f8 100644 >> --- a/tests/ofproto-macros.at >> +++ b/tests/ofproto-macros.at >> @@ -123,3 +123,12 @@ m4_define([ADD_OF_PORTS], >> [ovs-vsctl m4_foreach([of_port], m4_cdr($@), >> [ \ >> -- add-port $1 p[]of_port -- set Interface p[]of_port type=dummy >> ofport_request=of_port])]) >> + >> +# WAIT_FOR_DUMMY_PORTS(NETDEV_DUMMY_PORT[, NETDEV_DUMMY_PORT...]) >> +# >> +# Wait until the netdev dummy ports are connected to each other >> +m4_define([WAIT_FOR_DUMMY_PORTS], \ >> + [m4_foreach([dummy_port], [$@], >> + [ \ >> + OVS_WAIT_WHILE([ovs-appctl netdev-dummy/conn-state dummy_port \ >> + | grep 'unknown\|disconnected'], [sleep 1])])]) > > If the result is ever “unknown”, it is not likely to change even if we wait. > Is there a way to fail if “unknown” is seen? > Yes, ovs_wait will wait up to 10 seconds. > Oherwise, > > Acked-by: Jarno Rajahalme <jrajaha...@nicira.com> > _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev