diff --git a/ansible/roles/test/files/ptftests/vxlan_traffic.py b/ansible/roles/test/files/ptftests/vxlan_traffic.py index 4345cb8b5a..fdefc99a3a 100644 --- a/ansible/roles/test/files/ptftests/vxlan_traffic.py +++ b/ansible/roles/test/files/ptftests/vxlan_traffic.py @@ -93,23 +93,16 @@ def runTest(self): # find the list of neigh addresses for the t0_ports. For each neigh address(Addr1): # for each destination address(Addr2) in the same Vnet as t0_intf, # send traffic from Add1 to it. If there - # are multiple nexthops for the Addr2, then send that many different + # are multiple nexthops for the Addr2, then send that many different # streams(different tcp ports). neighbors = [self.config_data['neighbors'][t0_intf]] - ptf_port = self.get_ptf_port(t0_intf) + ptf_port = self.topo_data['minigraph_facts']['minigraph_ptf_indices'][t0_intf] vnet = self.config_data['vnet_intf_map'][t0_intf] vni = self.config_data['vnet_vni_map'][vnet] for addr in neighbors: for destination,nh in self.config_data['dest_to_nh_map'][vnet].iteritems(): self.test_encap(ptf_port, vni, addr, destination, nh, test_ecn=TEST_ECN) - def get_ptf_port(self, dut_port): - m = re.search('Ethernet([0-9]+)', dut_port) - if m: - return self.topo_data['tbinfo']['topo']['ptf_dut_intf_map'][m.group(1)]['0'] - else: - raise RuntimeError("dut_intf:{} doesn't match 'EthernetNNN'".format(dut_port)) - def cmd(self, cmds): process = subprocess.Popen(cmds, shell=False, diff --git a/tests/vxlan/test_vxlan_ecmp.py b/tests/vxlan/test_vxlan_ecmp.py index 434fcf0ad5..6456cfa7df 100644 --- a/tests/vxlan/test_vxlan_ecmp.py +++ b/tests/vxlan/test_vxlan_ecmp.py @@ -439,15 +439,15 @@ def get_t2_ports(duthost, minigraph_data): ''' list_of_portchannels_to_T2 = get_portchannels_to_neighbors(duthost, "T2", minigraph_data) list_of_interfaces = [] - for pc_name in list_of_portchannels_to_T2: - list_of_interfaces.extend(list_of_portchannels_to_T2[pc_name]) - - ret_list = [int(x[8:]) for x in list_of_interfaces] - if ret_list: - return ret_list + if list_of_portchannels_to_T2: + for pc_name in list_of_portchannels_to_T2: + list_of_interfaces.extend(list_of_portchannels_to_T2[pc_name]) + else: + list_of_interfaces = get_ethernet_to_neighbors("T2", minigraph_data) - list_of_ethernet_to_T2 = get_ethernet_to_neighbors("T2", minigraph_data) - ret_list.extend([int(x[8:]) for x in list_of_ethernet_to_T2]) + ret_list = [] + for iface in list_of_interfaces: + ret_list.append(minigraph_data["minigraph_ptf_indices"][iface]) return ret_list def bgp_established(duthost):