Skip to content

Commit

Permalink
chore: update show queue counters api to use -n (#15944)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
auspham authored Dec 11, 2024
1 parent 2e62e24 commit 12f5da6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/common/snappi_tests/common_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 12f5da6

Please sign in to comment.