[copp]: Added CoPP show configuration commands#3863
[copp]: Added CoPP show configuration commands#3863qiluo-msft merged 2 commits intosonic-net:masterfrom
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
2ac2edc to
39341d3
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@prabhataravind @prsunny please review. |
39341d3 to
b6a90e0
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
b6a90e0 to
379adaf
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/AzurePipelines run Azure.sonic-utilities |
|
Commenter does not have sufficient privileges for PR 3863 in repo sonic-net/sonic-utilities |
379adaf to
b69ff1d
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@rminnikanti , can you please resolve conflicts |
|
Also, please share a command output as per description template |
prsunny
left a comment
There was a problem hiding this comment.
lgtm, @qiluo-msft to merge
|
@rminnikanti Could you resolve conflict? |
What I did: CoPP show commands: * show copp configuration * show copp configuration detailed --trapid <trap_id> * show copp configuration detailed --group <group> Added UT for the CLI commands. HLD: sonic-net/SONiC#1943 Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
b69ff1d to
a3b4be1
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
@qiluo-msft Done. |
There was a problem hiding this comment.
Pull Request Overview
Adds CoPP (Control Plane Policing) CLI support, including show configuration and detailed views, with unit tests and documentation updates.
- Introduces
show copp configurationandshow copp configuration detailedcommands - Adds mock DB entries and unit tests for the new CLI paths
- Updates dump plugin mapping and command reference documentation
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/mock_tables/state_db.json | Added mock state entries for CoPP traps |
| tests/mock_tables/config_db.json | Added mock CONFIG_DB entries for CoPP groups/traps |
| tests/copp_test.py | New pytest cases for CoPP CLI |
| tests/copp_input/mock_config/mock_copp_cfg.json | Mock CoPP JSON config data |
| show/main.py | Registered copp commands in main CLI |
| show/copp.py | Implemented CoPP show commands and merge logic |
| dump/plugins/copp.py | Added neighbor_miss trap mapping |
| doc/Command-Reference.md | Documented CoPP commands in command reference |
Comments suppressed due to low confidence (3)
doc/Command-Reference.md:14900
- The sample output uses lowercase
queuehere, but the CLI printsQueuewith an uppercase Q. Update the doc to match the actual output.
queue....................... 1
doc/Command-Reference.md:14910
- The sample uses
Oper Status, but the implementation printsHW Status. Align the documentation to showHW Statusfor consistency.
Oper Status................. installed
show/copp.py:149
- There is no unit test covering the
FileNotFoundErrorbranch when the config file is missing. Add a test to verify that the warning is printed as expected.
with open(COPP_INIT_CFG_JSON_FILE, 'r') as file:
Signed-off-by: Ravi Minnikanti <rminnikanti@marvell.com>
Head branch was pushed to by a user without write access
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
What I did: Added CoPP show commands: show copp configuration show copp configuration detailed --trapid <trap_id> show copp configuration detailed --group <group> Added UT for the CLI commands. Why I did it Details in HLD: sonic-net/SONiC#1943 How to verify it Verified with UT
|
Hi @rminnikanti , please create PR and fix conflict to 202505 branch |
|
@yejianquan, created PR for 202505 #3955 |
|
@qiluo-msft @yejianquan to have this PR included in sonic master image we need to update the git submodule of src/sonic-utilties in sonic-buildimage. Can we please update submodule of src/sonic-utilities in master branch? This will help sonic-mgmt PR of this feature. Below is the last submodule update of sonic-utilities in sonic-buildimage master: commit c19ece7106b30d941aff8774f1742486eebc1ec3
Author: mssonicbld <79238446+mssonicbld@users.noreply.github.com>
Date: Thu May 22 19:01:49 2025 +0800
[submodule] Update submodule sonic-utilities to the latest HEAD automatically (#22614) |
What I did: Added CoPP show commands: show copp configuration show copp configuration detailed --trapid <trap_id> show copp configuration detailed --group <group> Added UT for the CLI commands. Why I did it Details in HLD: sonic-net/SONiC#1943 How to verify it Verified with UT
What I did:
Added CoPP show commands:
Added UT for the CLI commands.
Why I did it
Details in HLD: sonic-net/SONiC#1943
How to verify it
Verified with UT
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)
Signed-off-by: Ravi Minnikanti rminnikanti@marvell.com