This patch ensures that ts are populated in all azs.

This requires:
- AZs to be populated in ovn-ic-sb.
- ovn-ic-nbctl --wait=sb sync to ensure all ics run.

This fixes following tests:
- ovn-ic -- spine-leaf: 3 AZs, 3 HVs, 3 LSs, connected via transit spine switch.
- ovn-ic -- prefix filter -- filtering routes
- ovn-ic -- Backward compatibility of learning routes in the same AZ.
- ovn-ic -- prefix filter -- deny route adv
- ovn-ic -- Advertise discard static routes
- ovn-ic -- check loop with announce duplicated prefixes - multiple ts

Fixes: 67100f0ca819 ("ic: Add support for spine-leaf topology for transit 
switches.")
Fixes: f22b77b51ad2 ("ovn-ic: Add support for route prefix filter.")
Fixes: 951d99295023 ("ic: Fix route learning for backward compatibility to 
>=23.09.")
Fixes: 1059c46ffe06 ("ovn-ic: Add support to deny filter routes.")
Fixes: 93b5c914371b ("ic: Enable advertise static discard routes.")
Fixes: 69c2b8677de0 ("ic: Fix infinite route learning with same prefix and 
nexthop.")

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

---
v2: Added Ack from Mairtin
---
 tests/ovn-ic.at | 51 ++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 48 insertions(+), 3 deletions(-)

diff --git a/tests/ovn-ic.at b/tests/ovn-ic.at
index 4a498e573..5737acb0f 100644
--- a/tests/ovn-ic.at
+++ b/tests/ovn-ic.at
@@ -3325,6 +3325,14 @@ ovn_as az1 check ovn-nbctl ls-add ls1
 ovn_as az2 check ovn-nbctl ls-add ls2
 ovn_as az3 check ovn-nbctl ls-add ls3
 
+# Wait for all azs to be registered and sync ts changes.
+OVS_WAIT_FOR_OUTPUT([ovn-ic-sbctl show], [0], [dnl
+availability-zone az1
+availability-zone az2
+availability-zone az3
+])
+check ovn-ic-nbctl --wait=sb sync
+
 # Connect ls1 to spine.
 ovn_as az1
 check ovn-nbctl lsp-add spine spine-to-ls1
@@ -3881,6 +3889,13 @@ done
 # Create new transit switches and LRs. Test topology is next:
 # logical router (lr11) - transit switch (ts1) - logical router (lr12)
 
+# Wait for all azs to be registered and sync ts changes.
+OVS_WAIT_FOR_OUTPUT([ovn-ic-sbctl show], [0], [dnl
+availability-zone az1
+availability-zone az2
+])
+check ovn-ic-nbctl --wait=sb sync
+
 # Create lr11, lr12 and connect them to ts1.
 for i in 1 2; do
     ovn_as az$i
@@ -4533,6 +4548,18 @@ check ovn-nbctl set nb_global . 
options:ic-route-learn=true
 # Enable route advertising at AZ level
 check ovn-nbctl set nb_global . options:ic-route-adv=true
 
+# Add ts before creating fake az, so we can use "ovn-ic-nbctl --wait=sb sync"
+# to ensure ts are properly added. Fake az does not run hence does not handle
+# ovn-ic-nbctl --wait=sb sync.
+check ovn-ic-nbctl ts-add ts1
+check ovn-ic-nbctl ts-add ts2
+
+# Wait for ts to be added in az1.
+OVS_WAIT_FOR_OUTPUT([ovn-ic-sbctl show | grep az1], [0], [dnl
+availability-zone az1
+])
+check ovn-ic-nbctl --wait=sb sync
+
 # Create a fake availability zone to announce a route from.
 # This route will not have an lr-id in its external_ids, simulating
 # the behavior of the legacy code. The system is expected to
@@ -4542,9 +4569,6 @@ fake_az_uuid=$(fetch_column ic-sb:availability-zone _uuid 
name="fake_az")
 check_uuid ovn-ic-sbctl create Gateway name=fake_az_gw 
availability_zone=$fake_az_uuid \
     encap=@encap -- --id=@encap create encap type=geneve ip="192.168.0.2"
 
-check ovn-ic-nbctl ts-add ts1
-check ovn-ic-nbctl ts-add ts2
-
 check ovn-nbctl lr-add lr1
 check ovn-nbctl lrp-add lr1 lrp-lr1-ts1 aa:aa:aa:aa:aa:02 169.254.100.1/24
 check ovn-nbctl lsp-add-router-port ts1 lsp-ts1-lr1 lrp-lr1-ts1
@@ -4582,6 +4606,13 @@ for i in 1 2; do
     check ovn-nbctl set nb_global . options:ic-route-adv=true
 done
 
+# Wait for all azs to be registered and sync ts changes.
+OVS_WAIT_FOR_OUTPUT([ovn-ic-sbctl show], [0], [dnl
+availability-zone az1
+availability-zone az2
+])
+check ovn-ic-nbctl --wait=sb sync
+
 # Create routers and connect to transit switch
 for i in 1 2; do
     ovn_as az$i
@@ -5076,6 +5107,13 @@ for i in 1 2; do
     check ovn-nbctl set nb_global . options:ic-route-adv=true
 done
 
+# Wait for all azs to be registered and sync ts changes.
+OVS_WAIT_FOR_OUTPUT([ovn-ic-sbctl show], [0], [dnl
+availability-zone az1
+availability-zone az2
+])
+check ovn-ic-nbctl --wait=sb sync
+
 # Create new transit switches and LRs. Test topology is next:
 #
 # logical router (lr11) - transit switch (ts11) - logical router (lr12)
@@ -5127,6 +5165,13 @@ for i in 1 2; do
     check ovn-nbctl set nb_global . options:ic-route-adv=true
 done
 
+# Wait for all azs to be registered and sync ts changes.
+OVS_WAIT_FOR_OUTPUT([ovn-ic-sbctl show], [0], [dnl
+availability-zone az1
+availability-zone az2
+])
+check ovn-ic-nbctl --wait=sb sync
+
 for i in 1 2; do
     ovn_as az$i
 
-- 
2.47.1

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

Reply via email to