Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tests/bgp/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,16 +256,20 @@ def _setup_interfaces_dualtor(mg_facts, peer_count):
{
"local_intf": loopback_intf["name"],
"local_addr": "%s/%s" % (loopback_intf_addr, loopback_intf_prefixlen),
"neighbor_intf": "eth%s" % mg_facts["minigraph_port_indices"][local_interface],
# Note: Config same subnets on PTF will generate two connect routes on PTF.
# This may lead different IPs has same FDB entry on DUT even they are on different
# interface and cause layer3 packet drop on PTF, so here same interface for different
# neighbor.
"neighbor_intf": "eth%s" % mg_facts["minigraph_port_indices"][local_interfaces[0]],
"neighbor_addr": "%s/%s" % (mux_configs[local_interface]["server_ipv4"].split("/")[0], vlan_intf_prefixlen)
}
)

ptfhost.remove_ip_addresses()

for conn in connections:
ptfhost.shell("ifconfig %s %s" % (conn["neighbor_intf"],
conn["neighbor_addr"]))
ptfhost.shell("ip address add %s dev %s" % (conn["neighbor_addr"], conn["neighbor_intf"]))

ptfhost.shell("ip route add %s via %s" % (loopback_intf_addr, vlan_intf_addr))
yield connections

Expand Down