-
Notifications
You must be signed in to change notification settings - Fork 1k
Added adding static route before startup interfaces #14699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
5679bd7
3f7b842
94cb776
2dcbbe1
0762d16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ | |
| USE_INNER_HASHING = False | ||
| NUM_FLOWS = 1000 | ||
| ptf_to_dut_port_map = {} | ||
| ptf_to_dut_mac_map = {} | ||
|
|
||
| VXLAN_PORT = 13330 | ||
| DUT_VXLAN_PORT_JSON_FILE = '/tmp/vxlan.switch.json' | ||
|
|
@@ -111,23 +112,22 @@ def generate_fgnhg_config(duthost, ip_to_port, bank_0_port, bank_1_port): | |
|
|
||
|
|
||
| def setup_neighbors(duthost, ptfhost, ip_to_port): | ||
| duthost.shell("sonic-clear fdb all") | ||
| duthost.shell("sonic-clear arp") | ||
| duthost.shell("sonic-clear ndp") | ||
| vlan_name = "Vlan" + str(DEFAULT_VLAN_ID) | ||
| neigh_entries = {} | ||
| neigh_entries['NEIGH'] = {} | ||
|
|
||
| for ip, port in list(ip_to_port.items()): | ||
|
|
||
| neigh_mac = ptfhost.shell("cat /sys/class/net/eth" + str(port) + "/address")["stdout_lines"][0] | ||
| ptf_to_dut_mac_map[port] = neigh_mac | ||
| if isinstance(ipaddress.ip_address(six.text_type(ip)), ipaddress.IPv4Address): | ||
| neigh_entries['NEIGH'][vlan_name + "|" + ip] = { | ||
| "neigh": ptfhost.shell("cat /sys/class/net/eth" + str(port) + "/address")["stdout_lines"][0], | ||
| "neigh": neigh_mac, | ||
| "family": "IPv4" | ||
| } | ||
| else: | ||
| neigh_entries['NEIGH'][vlan_name + "|" + ip] = { | ||
| "neigh": ptfhost.shell("cat /sys/class/net/eth" + str(port) + "/address")["stdout_lines"][0], | ||
| "neigh": neigh_mac, | ||
| "family": "IPv6" | ||
| } | ||
|
|
||
|
|
@@ -267,6 +267,17 @@ def validate_packet_flow_without_neighbor_resolution(ptfhost, duthost, ip_to_por | |
| assert neigh_resolved | ||
|
|
||
|
|
||
| def static_neighbor_entry(duthost, ip, mac, prefix_list): | ||
| """ | ||
| Performs addition of static entries of ipv4 and v6 neighbors in DUT | ||
| """ | ||
| if isinstance(ipaddress.ip_network(prefix_list[0]), ipaddress.IPv4Network): | ||
| logger.info("adding ipv4 static arp entry for ip %s on DUT" % (ip)) | ||
| duthost.shell("sudo arp -s {0} {1}".format(ip, mac)) | ||
| else: | ||
| logger.info("adding ipv6 static arp entry for ip %s on DUT" % (ip)) | ||
| duthost.shell("sudo ip -6 neigh replace {0} lladdr {1} dev Vlan{2}".format(ip, mac, DEFAULT_VLAN_ID)) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is the static neighbor removed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From 202205 and newer version. When testing shut down an interface, the neighbor/Arp tables will lose the static neighbor
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My concern is the statically added neighbor will be there permanently, which may impact other tests running after test_fgnhg. Suggest adding a cleanup to remove the statically programmed neigh
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Neighbor entries will be flushed when reloading config after tests.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i thought we fixed it by sonic-net/sonic-swss#2469
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That PR is not fixing the issue we have on this test. |
||
|
|
||
| def fg_ecmp(ptfhost, duthost, router_mac, net_ports, port_list, ip_to_port, bank_0_port, bank_1_port, prefix_list): | ||
|
|
||
| # Init base test params | ||
|
|
@@ -330,6 +341,11 @@ def fg_ecmp(ptfhost, duthost, router_mac, net_ports, port_list, ip_to_port, bank | |
| logger.info("Send the same flows again, but unshut " + dut_if_shutdown + " and check " | ||
| "if flows reblanced as expected and are seen on now brought up link") | ||
|
|
||
| #add static neighbor | ||
| for nexthop, port in list(ip_to_port.items()): | ||
| if port == shutdown_link: | ||
| static_neighbor_entry(duthost, nexthop, ptf_to_dut_mac_map[port], prefix_list) | ||
alawing marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| configure_dut(duthost, "config interface startup " + dut_if_shutdown) | ||
| time.sleep(30) | ||
|
|
||
|
|
@@ -394,6 +410,11 @@ def fg_ecmp(ptfhost, duthost, router_mac, net_ports, port_list, ip_to_port, bank | |
| logger.info("Send the same flows again, but startup " + dut_if_shutdown + " and check " | ||
| "the flow hash redistribution") | ||
|
|
||
| #add static neighbor | ||
| for nexthop, port in list(ip_to_port.items()): | ||
| if port == shutdown_link: | ||
| static_neighbor_entry(duthost, nexthop, ptf_to_dut_mac_map[port], prefix_list) | ||
alawing marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| configure_dut(duthost, "config interface startup " + dut_if_shutdown) | ||
| time.sleep(30) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.