From 531afe0bdb406da5720108ec5a11d58e5335a64e Mon Sep 17 00:00:00 2001 From: Longxiang Lyu Date: Fri, 21 Feb 2025 09:07:56 +0000 Subject: [PATCH] [dualtor-io] Improve dualtor-io utility Two improvements: 1. force replace the dst arp responder config. 2. add show arp and neighbor check in I/O utility to help debug. Signed-off-by: Longxiang Lyu --- tests/common/dualtor/data_plane_utils.py | 3 +++ tests/common/dualtor/dual_tor_io.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/common/dualtor/data_plane_utils.py b/tests/common/dualtor/data_plane_utils.py index 145282aecfd..8bc7067fd62 100644 --- a/tests/common/dualtor/data_plane_utils.py +++ b/tests/common/dualtor/data_plane_utils.py @@ -213,6 +213,9 @@ def cleanup(ptfadapter, duthosts_list, ptfhost): ptfadapter.dataplane.flush() for duthost in duthosts_list: logger.info('Clearing arp entries on DUT {}'.format(duthost.hostname)) + # add show arp and neighbor check here to help debug + duthost.shell('show arp') + duthost.shell('dualtor_neighbor_check.py -o STDOUT') duthost.shell('sonic-clear arp') diff --git a/tests/common/dualtor/dual_tor_io.py b/tests/common/dualtor/dual_tor_io.py index 978c53aa8a8..cf59b5694e9 100644 --- a/tests/common/dualtor/dual_tor_io.py +++ b/tests/common/dualtor/dual_tor_io.py @@ -220,7 +220,7 @@ def __configure_arp_responder(self): arp_responder_conf['eth{}'.format(intf)] = [ip] with open("/tmp/from_t1.json", "w") as fp: json.dump(arp_responder_conf, fp, indent=4, sort_keys=True) - self.ptfhost.copy(src="/tmp/from_t1.json", dest="/tmp/from_t1.json") + self.ptfhost.copy(src="/tmp/from_t1.json", dest="/tmp/from_t1.json", force=True) self.ptfhost.shell("supervisorctl reread && supervisorctl update") self.ptfhost.shell("supervisorctl restart arp_responder") logger.info("arp_responder restarted")