Use next cidr to the configured one in the allowed_address_pair tests
In the
AllowedAddressPairTestJSON.test_update_port_with_cidr_address_pair API
test "self.cidr" was used as cidr to be set as allowed_address_pair for
the port. Since [1] it is forbidden by the ML2/OVN backend to set IP
address assigned to the metadata port (owner "network:distributed") as
allowed_address_pair for any port in the same network. This constraint
also applies to the CIDRs set as allowed_address_pair if metadata port's
IP address is included in that CIDR.
To avoid the issue in the tempest test, it now uses subnet which is next
to the one set as self.cidr - that way it will for sure not overlap with
the IP of the metadata port.
[1] https://review.opendev.org/c/openstack/neutron/+/954570
Related-bug: #2116249
Change-Id: Ib6f33a240ba78b39a28cb5aad6366cb29c26a568
Signed-off-by: Slawek Kaplonski <skaplons@redhat.com>
diff --git a/tempest/api/network/test_allowed_address_pair.py b/tempest/api/network/test_allowed_address_pair.py
index 01dda06..58160e0 100644
--- a/tempest/api/network/test_allowed_address_pair.py
+++ b/tempest/api/network/test_allowed_address_pair.py
@@ -124,7 +124,12 @@
@decorators.idempotent_id('4d6d178f-34f6-4bff-a01c-0a2f8fe909e4')
def test_update_port_with_cidr_address_pair(self):
"""Update allowed address pair with cidr"""
- self._update_port_with_address(str(self.cidr))
+ # NOTE(slaweq): We need to use the next IP subnet to the one which
+ # is configured in the tempest config as the self.cidr will include
+ # "distributed" port created by the ML2/OVN backend and adding this
+ # particular IP address to the allowed address pair is forbidden by
+ # the ML2/OVN backend.
+ self._update_port_with_address(str(self.cidr.next()))
@decorators.idempotent_id('b3f20091-6cd5-472b-8487-3516137df933')
def test_update_port_with_multiple_ip_mac_address_pair(self):