When a port is removed from a logical switch, the ct-zone is flushed, then the ct-zone-id is removed from external_ids. This is done in two steps (ct-zone-id is removed when the transaction flushing the ct_zone is complete). ovn-nbctl --wait=hv sync does not take this into account, and hence checking external_ids right after lsp-del lsp; ovn-nbctl --wait=hv sync might fail.
Signed-off-by: Xavier Simonart <xsimo...@redhat.com> v2: handled Mark's comment (i.e added comment in test) --- tests/ovn.at | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index 6f9fbbfd2..8cc76317d 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -10238,14 +10238,21 @@ AT_CHECK([test ! -z $foo2_zoneid]) bar2_zoneid=$(as hv2 ovs-vsctl get bridge br-int external_ids:ct-zone-bar2) AT_CHECK([test ! -z $bar2_zoneid]) -ovn-nbctl lsp-del bar2 +# When a port is removed from a logical switch, the ct-zone is flushed, then +# the ct-zone-id is removed from external_ids. This is done in two steps( +# ct-zone-id is removed when the transaction flushing the ct_zone is complete). +# ovn-nbctl --wait=hv sync does not take this into account, and hence we need +# two "wait=hv" before we are sure that the ct-zone-id is removed from +# external_ids. +ovn-nbctl --wait=hv lsp-del bar2 ovn-nbctl --wait=hv sync bar2_zoneid=$(as hv2 ovs-vsctl get bridge br-int external_ids:ct-zone-bar2) AT_CHECK([test -z $bar2_zoneid]) # Add back bar2 -ovn-nbctl lsp-add bar bar2 vm2 1 \ +# Same comment as above: two "wait=hv" are needed. +ovn-nbctl --wait=hv lsp-add bar bar2 vm2 1 \ -- lsp-set-addresses bar2 "f0:00:00:01:02:08 192.168.2.3" wait_for_ports_up ovn-nbctl --wait=hv sync -- 2.31.1 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev