[show interfaces] "show interfaces flap" command does not support multi-ASIC platforms#4316
Open
pnakka28 wants to merge 4 commits intosonic-net:masterfrom
Open
[show interfaces] "show interfaces flap" command does not support multi-ASIC platforms#4316pnakka28 wants to merge 4 commits intosonic-net:masterfrom
pnakka28 wants to merge 4 commits intosonic-net:masterfrom
Conversation
…ti-ASIC platforms - Added multi-ASIC support for namespace and display filtering - Added multi-ASIC tests in tests/flap_test.py Signed-off-by: Pavan Kalyan Nakka <pnakka@microsoft.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the SONiC show interfaces flap CLI to work on multi-ASIC systems by adding standard multi-ASIC options and aggregating flap data across namespaces, along with new multi-ASIC-focused unit tests and mock DB data.
Changes:
- Add
-n/--namespaceand-d/--displaysupport toshow interfaces flapusingmulti_asic_click_options. - Update the command implementation to iterate namespaces and collect flap data from each ASIC’s APPL_DB.
- Add multi-ASIC flap mock data and introduce a new multi-ASIC unit test file.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| show/interfaces/init.py | Adds multi-ASIC options to flap and aggregates flap data across namespaces/APP_DB instances. |
| tests/flap_test.py | Adds new unit tests for multi-ASIC show interfaces flap behavior. |
| tests/mock_tables/asic0/appl_db.json | Adds flap fields to asic0 PORT_TABLE mock data. |
| tests/mock_tables/asic1/appl_db.json | Adds flap fields to asic1 PORT_TABLE mock data. |
Signed-off-by: Pavan Kalyan Nakka <pnakka@microsoft.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Commenter does not have sufficient privileges for PR 4316 in repo sonic-net/sonic-utilities |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Pavan Kalyan Nakka <pnakka@microsoft.com>
c135e0e to
7e7f4f2
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
prgeor
reviewed
Mar 4, 2026
doc/Command-Reference.md
Outdated
| Ethernet8 4035 Up Up Sat Feb 21 11:00:41 2026 Sat Feb 21 11:00:59 2026 | ||
| Ethernet16 4015 Up Up Sat Feb 21 11:01:23 2026 Sat Feb 21 11:01:41 2026 | ||
| ``` | ||
| - Example (to only display flap count for interface Ethernet0): |
Contributor
There was a problem hiding this comment.
@pnakka28 please change comment to " display on mult-asic platform."
Signed-off-by: Pavan Kalyan Nakka <pnakka@microsoft.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
prgeor
reviewed
Mar 4, 2026
|
|
||
| # Display the formatted table | ||
| click.echo(tabulate(body, header)) | ||
|
|
Contributor
There was a problem hiding this comment.
@pnakka28 db connection does not need to be closed at the end?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Added multi-ASIC platform support for
show interfaces flapcommandHow I did it
multi_asic_click_optionsdecorator to support-n/--namespaceand-d/--displayoptionsasic0/appl_db.json,asic1/appl_db.json)tests/flap_test.pyHow to verify it
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)