From 6f58351479d53ffe2f797bc7418d2d3d86dc544a Mon Sep 17 00:00:00 2001 From: "Austin (Thang Pham)" Date: Wed, 11 Dec 2024 18:21:43 +1100 Subject: [PATCH] chore: update show queue counters api to use -n (#15944) Description of PR Previously we're using sudo ip netns exec asic0 show queue counter for showing the queue counter in multi-asic. However with the new apis, -n is supported natively in show queue counter -n asic0 This PR updates so that in get_egress_queue_count will use the new queue counters. The queue counter support was added in the original PR: suppport multi asic for show queue counter sonic-utilities#2439 Cherry-pick to 202205: Double commit #2439 suppport multi asic for show queue counter sonic-utilities#2647 Summary: Fixes # (issue) #15856 Approach What is the motivation for this PR? How did you do it? Adjust the command to use the new format show queue counter -n asic0 Signed-off-by: Austin Pham --- tests/common/snappi_tests/common_helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/common/snappi_tests/common_helpers.py b/tests/common/snappi_tests/common_helpers.py index 392f9701856..68ce47f8367 100644 --- a/tests/common/snappi_tests/common_helpers.py +++ b/tests/common/snappi_tests/common_helpers.py @@ -990,8 +990,8 @@ def get_egress_queue_count(duthost, port, priority): # If DUT is multi-asic, asic will be used. if duthost.is_multi_asic: asic = duthost.get_port_asic_instance(port).get_asic_namespace() - raw_out = duthost.shell("sudo ip netns exec {} show queue counters {} | sed -n '/UC{}/p'". - format(asic, port, priority))['stdout'] + raw_out = duthost.shell("show queue counters {} -n {} | sed -n '/UC{}/p'". + format(port, asic, priority))['stdout'] total_pkts = "0" if raw_out.split()[2] == "N/A" else raw_out.split()[2] total_bytes = "0" if raw_out.split()[3] == "N/A" else raw_out.split()[3] else: