[ovs-dev] [PATCH ovn v2] ovn.at: Fix test "virtual ports -- ovn-northd-ddlog".

Ben Pfaff blp at ovn.org
Mon Jun 14 18:44:51 UTC 2021


On Fri, Jun 11, 2021 at 03:48:52PM -0700, Han Zhou wrote:
> The test case fails quite often for northd-ddlog because of the tunnel
> keys mismatch when comparing OpenFlow rules. Keys can change in
> different runs. This patch fixes it by extracting the expected keys from
> SB DB before comparison instead of hardcoding.
> 
> There are some other potential timing issues in this test and this
> patch fixes them as well by replacing AT_CHECK with OVS_WAIT_UNTIL.
> 
> Signed-off-by: Han Zhou <hzhou at ovn.org>

Awesome!  Thank you.

> -AT_CHECK([test x$(ovn-sbctl --bare --columns chassis find port_binding \
> +OVS_WAIT_UNTIL([test x$(ovn-sbctl --bare --columns chassis find port_binding \
>  logical_port=sw0-vir) = x], [0], [])

I think the above can be better written:
    wait_row_count Port_Binding 0 logical_port=sw0-vir


>  # Cleanup hv1-vif3.
>  as hv1
>  ovs-vsctl del-port hv1-vif3
>  
> -AT_CHECK([test x$(ovn-sbctl --bare --columns chassis find port_binding \
> +OVS_WAIT_UNTIL([test x$(ovn-sbctl --bare --columns chassis find port_binding \
>  logical_port=sw0-vir) = x], [0], [])

Ditto?

> +    sw0_dp_key=$(fetch_column Datapath_Binding tunnel_key external_ids:name=sw0)
> +    lr0_dp_key=$(fetch_column Datapath_Binding tunnel_key external_ids:name=lr0)
> +    lr0_public_dp_key=$(fetch_column Port_Binding tunnel_key logical_port=lr0-public)

I think that the above will retrieve tunnel keys in decimal...

> +    AT_CHECK_UNQUOTED([as $hv ovs-ofctl dump-flows br-int table=44 | ofctl_strip_all | grep "priority=2000"], [0], [dnl
> + table=44, priority=2000,ip,metadata=0x$sw0_dp_key actions=resubmit(,45)
> + table=44, priority=2000,ipv6,metadata=0x$sw0_dp_key actions=resubmit(,45)
>  ])

...therefore I think that the above 0x should not be there.  (I guess
the test passes because the numbers in the test are all under 10.)

Thanks,

Ben.


More information about the dev mailing list