[ovs-dev] [PATCH v2 14/15] tests: Add test for sync command to ovn-nbctl test suite.

Mark Michelson mmichels at redhat.com
Thu Jul 12 21:10:14 UTC 2018


This is tough. The problem with a test like this is that you can't 
really tell that the sync is working as intended. It's possible that the 
ovn-nbctl is not actually waiting, but by coincidence, the database has 
its values updated before you check them.

You'd need something internal to ovn-nbctl to let you know that the 
database value has been updated prior to exiting to know for sure that 
the sync is working as intended.

On 07/12/2018 09:40 AM, Jakub Sitnicki wrote:
> Signed-off-by: Jakub Sitnicki <jkbs at redhat.com>
> ---
>   tests/ovn.at | 19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)
> 
> diff --git a/tests/ovn.at b/tests/ovn.at
> index d1a8967dd..adb99db77 100644
> --- a/tests/ovn.at
> +++ b/tests/ovn.at
> @@ -10541,3 +10541,22 @@ OVN_CHECK_PACKETS([hv2/vif2-tx.pcap], [vif2.expected])
>   
>   OVN_CLEANUP([hv1], [hv2])
>   AT_CLEANUP
> +
> +AT_SETUP([ovn -- sync])
> +ovn_start
> +
> +AT_CHECK([ovn-nbctl get NB_Global . nb_cfg], [0], [dnl
> +0
> +])
> +
> +AT_CHECK([ovn-nbctl --wait=sb sync])
> +AT_CHECK([ovn-nbctl get NB_Global . sb_cfg], [0], [dnl
> +1
> +])
> +
> +AT_CHECK([ovn-nbctl --wait=hv sync])
> +AT_CHECK([ovn-nbctl get NB_Global . hv_cfg], [0], [dnl
> +2
> +])
> +
> +AT_CLEANUP
> 



More information about the dev mailing list