diff mbox series

[ovs-dev,v2] tests: Fixed "nested containers" test

Message ID 20230530095406.3689578-1-xsimonar@redhat.com
State Accepted
Headers show
Series [ovs-dev,v2] tests: Fixed "nested containers" test | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes fail github build: failed

Commit Message

Xavier Simonart May 30, 2023, 9:54 a.m. UTC
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 <xsimonar@redhat.com>

v2: handled Mark's comment (i.e added comment in test)
---
 tests/ovn.at | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Comments

Dumitru Ceara June 8, 2023, 1:31 p.m. UTC | #1
On 5/30/23 11:54, Xavier Simonart wrote:
> 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 <xsimonar@redhat.com>
> 
> v2: handled Mark's comment (i.e added comment in test)
> ---

Applied to main and backported to all stable branches down to 22.03, thanks!
diff mbox series

Patch

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