From 883370bb1fc591885e58cd4ea4ccc90f4d370fd6 Mon Sep 17 00:00:00 2001 From: Dumitru Ceara Date: Sun, 22 Oct 2023 23:50:41 +0200 Subject: [PATCH] ovn_workload: Fix namespace address family check. Namespaces can (in theory) have different address family address sets in different IC clusters. Instead of checking the address set array (always not None), check to see if the corresponding per-AZ address set actually exists. Fixes: 2562afb45721 ("ovn-tester: extend density_light testing for ovn-ic") Signed-off-by: Dumitru Ceara --- ovn-tester/ovn_workload.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ovn-tester/ovn_workload.py b/ovn-tester/ovn_workload.py index aeaac719..7ea5cdd5 100644 --- a/ovn-tester/ovn_workload.py +++ b/ovn-tester/ovn_workload.py @@ -494,13 +494,13 @@ def add_ports(self, ports, az=0): # Always add port IPs to the address set but not to the PGs. # Simulate what OpenShift does, which is: create the port groups # when the first network policy is applied. - if self.addr_set4: - for i, nbctl in enumerate(self.nbctl): + for i, nbctl in enumerate(self.nbctl): + if self.addr_set4[i]: nbctl.address_set_add_addrs( self.addr_set4[i], [str(p.ip) for p in ports] ) - if self.addr_set6: - for i, nbctl in enumerate(self.nbctl): + for i, nbctl in enumerate(self.nbctl): + if self.addr_set6[i]: nbctl.address_set_add_addrs( self.addr_set6[i], [str(p.ip6) for p in ports] ) @@ -522,9 +522,9 @@ def unprovision(self): nbctl.port_group_del(self.pg_def_deny_igr[i]) nbctl.port_group_del(self.pg_def_deny_egr[i]) nbctl.port_group_del(self.pg[i]) - if self.addr_set4: + if self.addr_set4[i]: nbctl.address_set_del(self.addr_set4[i]) - if self.addr_set6: + if self.addr_set6[i]: nbctl.address_set_del(self.addr_set6[i]) nbctl.port_group_del(self.sub_pg[i]) nbctl.address_set_del(self.sub_as[i])