The system tests that run on ovn-fake-multinode deployments use 4
gateway and 4 regular chassis.  Make sure we check and clean them
all up.

Signed-off-by: Dumitru Ceara <dce...@redhat.com>
---
V2:
- Updated all callers of check_fake_multinode_setup() and
  cleanup_multinode_resources().
- Updated commit log to also mention the "check" changes.
---
 tests/multinode-macros.at | 14 ++++++++------
 tests/multinode.at        | 21 ++++++++++-----------
 2 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/tests/multinode-macros.at b/tests/multinode-macros.at
index 3f610f2e04..f2f767d80f 100644
--- a/tests/multinode-macros.at
+++ b/tests/multinode-macros.at
@@ -81,8 +81,7 @@ multinode_sbctl () {
 
 check_fake_multinode_setup_by_nodes() {
     check m_as ovn-central-az1 ovn-nbctl --wait=sb sync
-    for c in $1
-    do
+    for c; do
         AT_CHECK([m_as $c ovn-appctl -t ovn-controller version], [0], [ignore])
         on_exit "m_as $c ovs-vsctl list Interface > interfaces-${c}.txt"
         on_exit "m_as $c ovs-vsctl show > ovs-${chassis}.txt"
@@ -92,22 +91,25 @@ check_fake_multinode_setup_by_nodes() {
 }
 
 check_fake_multinode_setup() {
-    check_fake_multinode_setup_by_nodes 'ovn-chassis-1 ovn-chassis-2 ovn-gw-1 
ovn-gw-2'
+    check_fake_multinode_setup_by_nodes                         \
+        ovn-chassis-1 ovn-chassis-2 ovn-chassis-3 ovn-chassis-4 \
+        ovn-gw-1 ovn-gw-2 ovn-gw-3 ovn-gw-4
 }
 
 cleanup_multinode_resources_by_nodes() {
     m_as ovn-central-az1 rm -f /etc/ovn/ovnnb_db.db
     m_as ovn-central-az1 /usr/share/ovn/scripts/ovn-ctl restart_northd
     check m_as ovn-central-az1 ovn-nbctl --wait=sb sync
-    for c in $1
-    do
+    for c; do
         m_as $c ovs-vsctl del-br br-int
         m_as $c ip --all netns delete
     done
 }
 
 cleanup_multinode_resources() {
-    cleanup_multinode_resources_by_nodes 'ovn-chassis-1 ovn-chassis-2 ovn-gw-1'
+    cleanup_multinode_resources_by_nodes                        \
+        ovn-chassis-1 ovn-chassis-2 ovn-chassis-3 ovn-chassis-4 \
+        ovn-gw-1 ovn-gw-2 ovn-gw-3 ovn-gw-4
 }
 
 # multinode_cleanup_northd NODE
diff --git a/tests/multinode.at b/tests/multinode.at
index 0991b0e395..098ab49b1f 100644
--- a/tests/multinode.at
+++ b/tests/multinode.at
@@ -1585,11 +1585,11 @@ AT_CLEANUP
 
 AT_SETUP([ovn multinode load-balancer with multiple DGPs and multiple chassis])
 
-# Check that ovn-fake-multinode setup is up and running - requires additional 
nodes
-check_fake_multinode_setup_by_nodes 'ovn-chassis-1 ovn-chassis-2 ovn-chassis-3 
ovn-chassis-4 ovn-gw-1 ovn-gw-2'
+# Check that ovn-fake-multinode setup is up and running.
+check_fake_multinode_setup
 
 # Delete the multinode NB and OVS resources before starting the test.
-cleanup_multinode_resources_by_nodes 'ovn-chassis-1 ovn-chassis-2 
ovn-chassis-3 ovn-chassis-4 ovn-gw-1 ovn-gw-2'
+cleanup_multinode_resources
 
 # Reset geneve tunnels
 for c in ovn-chassis-1 ovn-chassis-2 ovn-chassis-3 ovn-chassis-4 ovn-gw-1 
ovn-gw-2
@@ -2103,11 +2103,11 @@ AT_CLEANUP
 
 AT_SETUP([ovn multinode load-balancer with multiple DGPs and multiple chassis 
- ECMP environment])
 
-# Check that ovn-fake-multinode setup is up and running - requires additional 
nodes
-check_fake_multinode_setup_by_nodes 'ovn-chassis-1 ovn-chassis-2 ovn-chassis-3 
ovn-gw-1 ovn-gw-2 ovn-gw-3 ovn-gw-4'
+# Check that ovn-fake-multinode setup is up and running
+check_fake_multinode_setup
 
 # Delete the multinode NB and OVS resources before starting the test.
-cleanup_multinode_resources_by_nodes 'ovn-chassis-1 ovn-chassis-2 
ovn-chassis-3 ovn-gw-1 ovn-gw-2 ovn-gw-3 ovn-gw-4'
+cleanup_multinode_resources
 
 # Reset geneve tunnels
 for c in ovn-chassis-1 ovn-chassis-2 ovn-chassis-3 ovn-gw-1 ovn-gw-2 ovn-gw-3 
ovn-gw-4
@@ -2816,11 +2816,10 @@ AT_SETUP([Migration of container ports])
 # setting iface-id on dst resp. before and after requested-chassis.
 
 # Check that ovn-fake-multinode setup is up and running
-# check_fake_multinode_setup
-check_fake_multinode_setup_by_nodes 'ovn-chassis-1 ovn-chassis-2 ovn-chassis-3'
+check_fake_multinode_setup
 
 # Delete the multinode NB and OVS resources before starting the test.
-cleanup_multinode_resources_by_nodes 'ovn-chassis-1 ovn-chassis-2 
ovn-chassis-3'
+cleanup_multinode_resources
 
 m_as ovn-chassis-1 ip link del migrator-p
 m_as ovn-chassis-2 ip link del sw0-port1-p
@@ -3124,10 +3123,10 @@ m_as ovn-gw-2 ovn-appctl vlog/set vconn:dbg
 m_as ovn-gw-1 ovn-appctl vlog/disable-rate-limit
 m_as ovn-gw-2 ovn-appctl vlog/disable-rate-limit
 
-check_fake_multinode_setup_by_nodes 'ovn-chassis-1 ovn-chassis-2 ovn-gw-1 
ovn-gw-2'
+check_fake_multinode_setup
 
 # Delete the multinode NB and OVS resources before starting the test.
-cleanup_multinode_resources_by_nodes 'ovn-chassis-1 ovn-chassis-2 ovn-gw-1 
ovn-gw-2'
+cleanup_multinode_resources
 
 ip_ch1=$(m_as ovn-chassis-1 ip a show dev eth1 | grep "inet " | awk '{print 
$2}'| cut -d '/' -f1)
 ip_gw1=$(m_as ovn-gw-1 ip a show dev eth1 | grep "inet " | awk '{print $2}'| 
cut -d '/' -f1)
-- 
2.49.0

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to