Skip to content

Commit 2d090ba

Browse files
rraghav-ciscogshemesh2
authored andcommitted
Cisco-8000:Snappi:Fix the arp deletion code in cisco-8000 fixture. (sonic-net#21064)
Description of PR Summary: In the cisco-specific function: gen_data_flow_dest_ip(), we also have a code to delete arp entries created by the same function. But that code is not really correct. It was not caught due to the try-except block protecting it. Essentially, the arguments to the arp delete CLI is wrong. This PR fixes this issue, with the correct arguments to the arp delete. Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Back port request 202205 202305 202311 202405 202411 202505 Approach What is the motivation for this PR? The arp delete will not work with the current code. This PR is fixing the arguments to the arp delete. How did you do it? By calculating the correct arguments to the arp delete. How did you verify/test it? Ran it on T1 and T2 devices. Any platform specific information? Specific to cisco-8000 only. @sdszhang , @auspham : FYI. ssigned-off-by: [email protected] Signed-off-by: Guy Shemesh <[email protected]>
1 parent b39bbe2 commit 2d090ba

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tests/common/snappi_tests/snappi_fixtures.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,9 +1559,16 @@ def gen_data_flow_dest_ip(addr, dut=None, intf=None, namespace=None, setup=True)
15591559
asic_arg = ""
15601560
if namespace is not None:
15611561
asic_arg = f"ip netns exec {namespace}"
1562+
int_arg = ""
1563+
if intf:
1564+
int_arg = f"-i {intf}"
1565+
if setup:
1566+
arp_opt = f"-s {addr} aa:bb:cc:dd:ee:ff"
1567+
else:
1568+
arp_opt = f"-d {addr}"
1569+
15621570
try:
1563-
dut.shell("{} arp -i {} -s {} aa:bb:cc:dd:ee:ff".format(
1564-
asic_arg, intf, addr))
1571+
dut.shell(f"sudo {asic_arg} arp {int_arg} {arp_opt}")
15651572
dut.shell(
15661573
"{} config route {} prefix {}/32 nexthop {} {}".format(
15671574
asic_arg, cmd, DEST_TO_GATEWAY_MAP[addr]['dest'], addr,

0 commit comments

Comments
 (0)