Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multi-asic behaviour for queuestat #3554

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arista-hpandya
Copy link
Contributor

@arista-hpandya arista-hpandya commented Sep 23, 2024

What I did

  • Added support for iterating over all namespaces (ns) when none specified
  • Added a test case to verify all ns behaviour
  • Introduced a wrapper class to handle the mutli-asic functionality
  • Replaced argparse with click for better argument checks

This is in accordance to the issue sonic-net/sonic-buildimage#15148 which tracks the multi-asic support for scripts in sonic-utilities.

How I did it

Modified the queuestat script and associated test files.

How to verify it

The changes were verified by:

  • Running all the unit tests in conic-utilities
  • Verifying the changes manually on a T2 single-asic linecard
  • Verifying the changes manually on a multi-asic linecard

Previous command output (if the output of a command-line utility has changed)

Cmd: queuestat
Result: Empty

Reason: When the namespace (-n/--namespace) argument is not specified on a multi asic device the scripts will return nothing.

New command output (if the output of a command-line utility has changed)

Cmd: queuestat
Result: Runs on all asics present on the device.

Reason: To be consistent with the other PRs in #15148, we iterate over all namespaces when none is specified on a multi-asic device.

Test snapshots provided below:

Specifying invalid namespace on single asic devices: queuestat -n asic0

single asic invalid arg

Single asic behaviour is preserved: queuestat -p Ethernet152

single asic normal

Multi asic behaviour when namespace is specified: queuestat -n asic1 -p Ethernet-Rec1

multiasic specific asic

Multi asic behaviour when no namespace is specified: queuestat

multiasic all ns p1
.
.
.
multiasic all ns p2
.
.
.

- Added support for iterating over all namespaces (ns) when none specified
- Added a test case to verify all ns behaviour
- Introduced a wrapper class to handle the mutli-asic functionality
- Replaced argparse with click for better argument checks
@kenneth-arista
Copy link
Contributor

Copy link
Contributor

@wenyiz2021 wenyiz2021 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

result LGTM, haven't check code details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants