[ovs-dev] [PATCH 3/3] test: Remove explicit sleeps from ofproto-dpif bond tests

Jarno Rajahalme jrajahalme at nicira.com
Sat Jun 7 02:42:18 UTC 2014


> On Jun 6, 2014, at 4:35 PM, Andy Zhou <azhou at nicira.com> wrote:
> 
> Ofproto-dpif bond tests relies on netdev-dummy ports to set up
> socket connection before actual tests. The time required
> for socket connection varies depends on system load, making the test
> prone to failure with simple sleep calls. On the other hand,
> conservative sleep value for the slowest machine may be excessive on
> a faster machine.
> 
> This patch removes the sleep calls. Replace them with
> WAIT_FOR_DUMMY_PORTS() introduced in the last patch, thus removing
> the timing dependency.
> 
> CC: Jarno Rajahalme <jrajahalme at nicira.com>
> Signed-off-by: Andy Zhou <azhou at nicira.com>
> ---
> tests/ofproto-dpif.at | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
> index e587d0d..e522e3e 100644
> --- a/tests/ofproto-dpif.at
> +++ b/tests/ofproto-dpif.at
> @@ -16,9 +16,8 @@ OVS_VSWITCHD_START(
>    add-port br1 p3 -- set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
>    add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
>    add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
> -sleep 2
> +WAIT_FOR_DUMMY_PORTS([p3], [p4])
> AT_CHECK([ovs-appctl vlog/set dpif:dbg])
> -
> AT_CHECK([ovs-ofctl add-flow br0 action=normal])
> AT_CHECK([ovs-ofctl add-flow br1 action=normal])
> ovs-appctl netdev-dummy/set-admin-state up
> @@ -67,14 +66,12 @@ OVS_VSWITCHD_START(
>    add-port br1 p5 -- set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
>    add-port br1 p6 -- set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
>    add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
> -sleep 2
> +WAIT_FOR_DUMMY_PORTS([p4], [p5], [p6])
> AT_CHECK([ovs-ofctl add-flow br0 action=normal])
> AT_CHECK([ovs-ofctl add-flow br1 action=normal])
> -AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
> -])

Why this change?

> ovs-appctl netdev-dummy/set-admin-state up
> ovs-appctl time/stop
> -ovs-appctl time/warp 100
> +ovs-appctl time/wrap 100

This seems unintentional.

> (
> for i in `seq 0 100 |xargs printf '%02x\n'`;
>     do
> @@ -120,7 +117,7 @@ AT_CHECK([ovs-ofctl add-flow br0 action=normal])
> AT_CHECK([ovs-ofctl add-flow br1 action=normal])
> AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
> ], [])
> -sleep 2
> +WAIT_FOR_DUMMY_PORTS([p4], [p5], [p6])
> ovs-appctl time/stop
> ovs-appctl time/warp 100
> ovs-appctl lacp/show > lacp.txt
> -- 
> 1.9.1
> 



More information about the dev mailing list