summaryrefslogtreecommitdiffstats
path: root/nfvbench/chain_router.py
diff options
context:
space:
mode:
authormklyus <mklyus@cisco.com>2020-04-13 10:36:08 +0300
committermklyus <mklyus@cisco.com>2020-04-27 22:36:54 +0300
commitf34214799a03f08d02f1ef1f1fc3c91970030f89 (patch)
tree7705f853eb77dd804a57ea0dba2b9283ffbebc05 /nfvbench/chain_router.py
parenta302be9afab5879a8f52153202ff972712d6b2e8 (diff)
l3-router fixes
Change-Id: I025c97af8003e797b8cd3133e0b2d64694fe4b58 Signed-off-by: mklyus <mklyus@cisco.com>
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]