Rectify test of bgp l3vpn
Related-Bug: PRODX-11809
Change-Id: Ifa2f905000a4e8123e7905af4faa8fc94d1ee064
diff --git a/neutron_tempest_plugin/bgpvpn/scenario/test_bgpvpn_advanced.py b/neutron_tempest_plugin/bgpvpn/scenario/test_bgpvpn_advanced.py
index d4fe6d3..ed8abe0 100644
--- a/neutron_tempest_plugin/bgpvpn/scenario/test_bgpvpn_advanced.py
+++ b/neutron_tempest_plugin/bgpvpn/scenario/test_bgpvpn_advanced.py
@@ -86,7 +86,8 @@
"""
self._create_networks_and_subnets(
- subnet_cidr=CONF.bgpvpn.l3vpn_endpoint
+ subnet_cidr=CONF.bgpvpn.l3vpn_private_subnet,
+ reserve_ip_address=False,
)
self._create_server()
self._create_bgpvpn(rts=CONF.bgpvpn.route_target)
@@ -96,7 +97,11 @@
)
def _create_networks_and_subnets(
- self, name="bgp", subnet_cidr=None, port_security=True
+ self,
+ name="bgp",
+ subnet_cidr=None,
+ port_security=True,
+ reserve_ip_address=True,
):
self.network = self._create_network(
namestart=name, port_security_enabled=port_security
@@ -104,7 +109,10 @@
self.subnet = self._create_subnet_with_cidr(
self.network, cidr=subnet_cidr, ip_version=4
)
- self._reserve_ip_address(subnet_cidr.split("/")[0], self.os_primary)
+ if reserve_ip_address:
+ self._reserve_ip_address(
+ subnet_cidr.split("/")[0], self.os_primary
+ )
def _create_subnet_with_cidr(
self, network, subnets_client=None, namestart="subnet-bgp", **kwargs
diff --git a/neutron_tempest_plugin/config.py b/neutron_tempest_plugin/config.py
index 9917817..bac18f9 100644
--- a/neutron_tempest_plugin/config.py
+++ b/neutron_tempest_plugin/config.py
@@ -165,6 +165,10 @@
default=200,
help=("Maximum number for the range of "
"assigned number for distinguishers.")),
+ cfg.StrOpt('l3vpn_private_subnet',
+ default='10.22.0.0/24',
+ help=("IP Address/Mask of instance, which will be "
+ "used to test the l3vpn connectivity.")),
cfg.StrOpt('l3vpn_endpoint',
default=None,
help=("IP Address/Mask, which will be used to "