Skip to content

Commit

Permalink
ovn_workload: Fix namespace address family check.
Browse files Browse the repository at this point in the history
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: 2562afb ("ovn-tester: extend density_light testing for ovn-ic")
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
  • Loading branch information
dceara committed Oct 22, 2023
1 parent 36e31b0 commit 883370b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ovn-tester/ovn_workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
)
Expand All @@ -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])
Expand Down

0 comments on commit 883370b

Please sign in to comment.