Skip to content

Commit

Permalink
test: add WAIT_FOR_DUMMY_PORTS helper macro for writing tests
Browse files Browse the repository at this point in the history
Add a macro to waiting until all ports supplied are connected.

CC: Jarno Rajahalme <[email protected]>
Signed-off-by: Andy Zhou <[email protected]>
Acked-by: Jarno Rajahalme <[email protected]>
  • Loading branch information
azhou-nicira committed Jun 10, 2014
1 parent 7d7fffe commit 76c22ad
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/ofproto-macros.at
Original file line number Diff line number Diff line change
Expand Up @@ -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'])])])

0 comments on commit 76c22ad

Please sign in to comment.