summaryrefslogtreecommitdiffstats
path: root/nfvbench/chain_router.py
diff options
context:
space:
mode:
Diffstat (limited to 'nfvbench/chain_router.py')
-rw-r--r--nfvbench/chain_router.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/nfvbench/chain_router.py b/nfvbench/chain_router.py
index ac89476..99114e0 100644
--- a/nfvbench/chain_router.py
+++ b/nfvbench/chain_router.py
@@ -80,6 +80,11 @@ class ChainRouter(object):
.format(router=self.name,
sub_id=subnet.network['subnets'][0]))
interfaces = self.manager.neutron_client.list_ports(device_id=router['id'])['ports']
+ # This string filters nfvbench networks in case when some other specific networks
+ # created and attached to the test nfvebnch router manually or automatically
+ # like in case of HA when neutron router virtually present on several network nodes
+ interfaces = [x for x in interfaces if x['fixed_ips'][0]['subnet_id'] in
+ [s.network['subnets'][0] for s in self.subnets]]
for interface in interfaces:
if self.is_ip_in_network(
interface['fixed_ips'][0]['ip_address'],
@@ -125,6 +130,8 @@ class ChainRouter(object):
router_interface = {'subnet_id': subnet.network['subnets'][0]}
self.manager.neutron_client.add_interface_router(router_id, router_interface)
interfaces = self.manager.neutron_client.list_ports(device_id=router_id)['ports']
+ interfaces = [x for x in interfaces if x['fixed_ips'][0]['subnet_id'] in
+ [s.network['subnets'][0] for s in self.subnets]]
for interface in interfaces:
itf = interface['fixed_ips'][0]['ip_address']
cidr0 = self.manager.config.traffic_generator.tg_gateway_ip_cidrs[0]