ovn-ic-nbctl --wait=sb sync does not wait for AZ to be created.

ovn-ic-nbctl --wait=sb sync writes IC_NB_Global->nb_ic_cfg in IC_NB and
waits for IC_NB:IC_NB_Global->sb_ic_cfg to be updated.
When notified, ic in AZs will update IC_SB:az->nb_ic_cfg and will check
that all the AZs are updated successfully in IC_SB->az before updating
IC_SB:IC_SB_Global->nb_ic_cfg and IC_NB:IC_NB_Global->sb_ic_cfg.

However, even if ic(x) has already been started in az(x), there is
no guarantee that the AZ(x) has been created in IC_SB at this time.
In other words, it is not correct to use 'ovn-ic-nbctl --wait=sb sync' and
expect that it waits for all AZ to be properly started.

Multiple ic tests were randomly failing for this reason.
- ovn-ic -- Add transit router
- ovn-ic -- Transit router delete port
- ovn-ic -- Port binding deletion upon transit router deletion

Few other tests were modified to follow the same check pattern.

Fixes: 89eb631d5de6 ("ic: Add Transit router support.")
Fixes: e5565a990ee5 ("ic: Add Transit Router port support.")

Signed-off-by: Xavier Simonart <[email protected]>
Acked-by: Mairtin O'Loingsigh <[email protected]>

---
v2: Added Ack from Mairtin
---
 tests/ovn-ic.at | 28 +++++++++++-----------------
 1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/tests/ovn-ic.at b/tests/ovn-ic.at
index eb3b7efef..4a498e573 100644
--- a/tests/ovn-ic.at
+++ b/tests/ovn-ic.at
@@ -4770,11 +4770,11 @@ ovn_init_ic_db
 ovn_start az1
 ovn_start az2
 
-check ovn-ic-nbctl --wait=sb sync
-AT_CHECK([ovn-ic-sbctl show], [0], [dnl
+OVS_WAIT_FOR_OUTPUT([ovn-ic-sbctl show], [0], [dnl
 availability-zone az1
 availability-zone az2
 ])
+check ovn-ic-nbctl --wait=sb sync
 
 ovn_as az1
 check ovn-ic-nbctl tr-add tr0
@@ -4803,13 +4803,11 @@ net_add n2
 ovn_start az1
 ovn_start az2
 
-OVS_WAIT_UNTIL([test 2 = `ovn-ic-sbctl show | wc -l`])
-
-check ovn-ic-nbctl --wait=sb sync
-AT_CHECK([ovn-ic-sbctl show], [0], [dnl
+OVS_WAIT_FOR_OUTPUT([ovn-ic-sbctl show], [0], [dnl
 availability-zone az1
 availability-zone az2
 ])
+check ovn-ic-nbctl --wait=sb sync
 
 sim_add hv1
 as hv1
@@ -4861,9 +4859,7 @@ net_add n2
 ovn_start az1
 ovn_start az2
 
-OVS_WAIT_UNTIL([test 2 = `ovn-ic-sbctl show | wc -l`])
-
-AT_CHECK([ovn-ic-sbctl show], [0], [dnl
+OVS_WAIT_FOR_OUTPUT([ovn-ic-sbctl show], [0], [dnl
 availability-zone az1
 availability-zone az2
 ])
@@ -4911,11 +4907,11 @@ net_add n2
 ovn_start az1
 ovn_start az2
 
-check ovn-ic-nbctl --wait=sb sync
-AT_CHECK([ovn-ic-sbctl show], [0], [dnl
+OVS_WAIT_FOR_OUTPUT([ovn-ic-sbctl show], [0], [dnl
 availability-zone az1
 availability-zone az2
 ])
+check ovn-ic-nbctl --wait=sb sync
 
 sim_add hv1
 as hv1
@@ -4963,11 +4959,11 @@ net_add n2
 ovn_start az1
 ovn_start az2
 
-check ovn-ic-nbctl --wait=sb sync
-AT_CHECK([ovn-ic-sbctl show], [0], [dnl
+OVS_WAIT_FOR_OUTPUT([ovn-ic-sbctl show], [0], [dnl
 availability-zone az1
 availability-zone az2
 ])
+check ovn-ic-nbctl --wait=sb sync
 
 sim_add hv1
 as hv1
@@ -5020,13 +5016,11 @@ net_add n2
 ovn_start az1
 ovn_start az2
 
-OVS_WAIT_UNTIL([test 2 = `ovn-ic-sbctl show | wc -l`])
-
-check ovn-ic-nbctl --wait=sb sync
-AT_CHECK([ovn-ic-sbctl show], [0], [dnl
+OVS_WAIT_FOR_OUTPUT([ovn-ic-sbctl show], [0], [dnl
 availability-zone az1
 availability-zone az2
 ])
+check ovn-ic-nbctl --wait=sb sync
 
 sim_add hv1
 as hv1
-- 
2.47.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to