- generator_config.update(matching_profile[0])
-
- return generator_config
-
- def __prep_interfaces(self, generator_config):
- src_config = {
- 'chain_count': self.service_chain_count,
- 'flow_count': self.flow_count / 2,
- 'ip': generator_config.ip_addrs[0],
- 'ip_addrs_step': self.ip_addrs_step,
- 'gateway_ip': self.gateway_ips[0],
- 'gateway_ip_addrs_step': self.gateway_ip_addrs_step,
- 'tg_gateway_ip': generator_config.tg_gateway_ip_addrs[0],
- 'tg_gateway_ip_addrs_step': self.tg_gateway_ip_addrs_step,
- 'udp_src_port': generator_config.udp_src_port,
- 'udp_dst_port': generator_config.udp_dst_port,
- 'vlan_tagging': self.vlan_tagging,
- 'dst_mac': generator_config.mac_addrs_left
- }
- dst_config = {
- 'chain_count': self.service_chain_count,
- 'flow_count': self.flow_count / 2,
- 'ip': generator_config.ip_addrs[1],
- 'ip_addrs_step': self.ip_addrs_step,
- 'gateway_ip': self.gateway_ips[1],
- 'gateway_ip_addrs_step': self.gateway_ip_addrs_step,
- 'tg_gateway_ip': generator_config.tg_gateway_ip_addrs[1],
- 'tg_gateway_ip_addrs_step': self.tg_gateway_ip_addrs_step,
- 'udp_src_port': generator_config.udp_src_port,
- 'udp_dst_port': generator_config.udp_dst_port,
- 'vlan_tagging': self.vlan_tagging,
- 'dst_mac': generator_config.mac_addrs_right
- }
-
- self.src_device = Device(**dict(src_config, **generator_config.interfaces[0]))
- self.dst_device = Device(**dict(dst_config, **generator_config.interfaces[1]))
- self.src_device.set_destination(self.dst_device)
- self.dst_device.set_destination(self.src_device)
-
- if self.service_chain == ChainType.EXT and not self.no_arp \
- and self.src_device.ip_range_overlaps():
- raise Exception('Overlapping IP address ranges src=%s dst=%d flows=%d' %
- self.src_device.ip,
- self.dst_device.ip,
- self.flow_count)
-
- @property
- def devices(self):
- return [self.src_device, self.dst_device]
-
- @property
- def vlans(self):
- return [self.src_device.vtep_vlan, self.dst_device.vtep_vlan]
-
- @property
- def ports(self):
- return [self.src_device.port, self.dst_device.port]