Skip to content

Commit

Permalink
tests: Fixed "nested containers" test
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
(cherry picked from commit 1967c9e)
  • Loading branch information
simonartxavier authored and dceara committed Jun 8, 2023
1 parent 43702c3 commit 8efb9df
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/ovn.at
Original file line number Diff line number Diff line change
Expand Up @@ -9917,14 +9917,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
Expand Down

0 comments on commit 8efb9df

Please sign in to comment.