From d96ce6d3bc6bdbec517b012f67d9ec081c530984 Mon Sep 17 00:00:00 2001 From: "Austin (Thang Pham)" Date: Fri, 5 Dec 2025 17:01:40 +1100 Subject: [PATCH] fix: fix arp_update complains missing interface entry for static route (#21513) Fix E 2025 Nov 26 22:08:52.060655 ERR swss2#arp_update[16275]: 178 missing interface entry for static route 20.1.1.1 What is the motivation for this PR? For tear down, we need to remove the route first before the arp. Otherwise swss will throw error How did you do it? How did you verify/test it? MS Only: https://elastictest.org/scheduler/testplan/692f7c4c8a84f286cc565304 Signed-off-by: Austin Pham --- tests/common/snappi_tests/snappi_fixtures.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/common/snappi_tests/snappi_fixtures.py b/tests/common/snappi_tests/snappi_fixtures.py index cc9b4d1b5b9..447373308de 100755 --- a/tests/common/snappi_tests/snappi_fixtures.py +++ b/tests/common/snappi_tests/snappi_fixtures.py @@ -1515,6 +1515,7 @@ def gen_data_flow_dest_ip(addr, dut=None, intf=None, namespace=None, setup=True) if setup: cmd = "add" asic_arg = "" + if namespace is not None: asic_arg = f"ip netns exec {namespace}" int_arg = "" @@ -1526,11 +1527,18 @@ def gen_data_flow_dest_ip(addr, dut=None, intf=None, namespace=None, setup=True) arp_opt = f"-d {addr}" try: - dut.shell(f"sudo {asic_arg} arp {int_arg} {arp_opt}") - dut.shell( - "{} config route {} prefix {}/32 nexthop {} {}".format( - asic_arg, cmd, DEST_TO_GATEWAY_MAP[addr]['dest'], addr, - DEST_TO_GATEWAY_MAP[addr]['intf'])) + if setup: + dut.shell(f"sudo {asic_arg} arp {int_arg} {arp_opt}") + dut.shell( + f"{asic_arg} config route {cmd} prefix {DEST_TO_GATEWAY_MAP[addr]['dest']}/32 nexthop " + f"{addr} {DEST_TO_GATEWAY_MAP[addr]['intf']}" + ) + else: + dut.shell( + f"{asic_arg} config route {cmd} prefix {DEST_TO_GATEWAY_MAP[addr]['dest']}/32 nexthop " + f"{addr} {DEST_TO_GATEWAY_MAP[addr]['intf']}" + ) + dut.shell(f"sudo {asic_arg} arp {int_arg} {arp_opt}") except RunAnsibleModuleFail: if setup: raise