Merge "Update load balancer tests to use allocation pools" into mcp/epoxy
diff --git a/octavia_tempest_plugin/tests/test_base.py b/octavia_tempest_plugin/tests/test_base.py
index 2f58dfc..7793974 100644
--- a/octavia_tempest_plugin/tests/test_base.py
+++ b/octavia_tempest_plugin/tests/test_base.py
@@ -13,6 +13,7 @@
# under the License.
import ipaddress
+import netaddr
import os
import random
import re
@@ -451,12 +452,20 @@
cls.lb_mem_net_client.show_network,
cls.lb_member_vip_net['id'])
+ # Add allocation pool to prevent IP address conflicts with portprober
+ cidr = netaddr.IPNetwork(CONF.load_balancer.vip_subnet_cidr)
+ pool_start = ipaddress.ip_address(str(cidr[101]))
+ pool_end = ipaddress.ip_address(str(cidr[254]))
+ allocation_pools = [{'start': str(pool_start), 'end': str(pool_end)}]
+
# Create tenant VIP subnet
subnet_kwargs = {
'name': data_utils.rand_name("lb_member_vip_subnet"),
'network_id': cls.lb_member_vip_net['id'],
'cidr': CONF.load_balancer.vip_subnet_cidr,
- 'ip_version': 4}
+ 'ip_version': 4,
+ 'allocation_pools': allocation_pools
+ }
result = cls.lb_mem_subnet_client.create_subnet(**subnet_kwargs)
cls.lb_member_vip_subnet = result['subnet']
LOG.info('lb_member_vip_subnet: %s', cls.lb_member_vip_subnet)