Skip to content

Commit 1ba21f3

Browse files
lizhijianrdsreejithsreekumaran
authored andcommitted
[M0-2VLAN] Update test_vlan_ping for m0-2vlan topo (sonic-net#15503)
What is the motivation for this PR? Update test_vlan_ping for m0-2vlan topo. How did you do it? Use topo_type instead of topo_name. How did you verify/test it? Verified on Nokia-7215 M0-2VLAN testbed.
1 parent 439d615 commit 1ba21f3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/vlan/test_vlan_ping.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ def vlan_ping_setup(duthosts, rand_one_dut_hostname, ptfhost, nbrhosts, tbinfo,
6060
vm_host_info = {}
6161

6262
vm_name, vm_info = None, None
63-
topo_name = tbinfo["topo"]["name"]
63+
topo_type = tbinfo["topo"]["type"]
6464
for nbr_name, nbr_info in list(nbrhosts.items()):
65-
if topo_name != "m0" or (topo_name == "m0" and "M1" in nbr_name):
65+
if topo_type != "m0" or (topo_type == "m0" and "M1" in nbr_name):
6666
vm_name = nbr_name
6767
vm_info = nbr_info
6868
break
6969

7070
py_assert(vm_name is not None, "Can't get neighbor vm")
71-
if topo_name == "mx":
71+
if topo_type == "mx":
7272
vm_ip_with_prefix = six.ensure_text(vm_info['conf']['interfaces']['Ethernet1']['ipv4'])
7373
output = vm_info['host'].command("ip addr show dev eth1")
7474
else:
@@ -104,7 +104,7 @@ def vlan_ping_setup(duthosts, rand_one_dut_hostname, ptfhost, nbrhosts, tbinfo,
104104
# Get the bgp neighbor connected to the selected VM
105105
if a_bgp_nbr['name'] == vm_name and a_bgp_nbr['addr'] == str(vm_host_info['ipv4']):
106106
# Find the interface that connects to the selected VM
107-
if topo_name == "mx":
107+
if topo_type == "mx":
108108
for intf in mg_facts['minigraph_interfaces']:
109109
if intf['peer_addr'] == str(vm_host_info['ipv4']):
110110
vm_host_info['port_index_list'] = [mg_facts['minigraph_ptf_indices'][intf['attachto']]]

0 commit comments

Comments
 (0)