Skip to content

[CoPP]: Added neighbor_miss trap verification and cli test #18326

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

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

Conversation

rminnikanti
Copy link
Contributor

@rminnikanti rminnikanti commented May 10, 2025

Description of PR

  1. Added/updated tests to cover sonic-net/SONiC#1943
  2. If the platform supports the CoPP neighbor_miss trap, verify that VLAN subnet traffic is policed under the neighbor_miss CoPP (200 PPS). If not, verify it under the existing default CoPP logic.
  3. CoPP trap capability of platform is determined by COPP_TRAP_CAPABILITY_TABLE in STATE_DB.
  4. Added a test case to verify the show copp configuration CLI output - test_verify_copp_configuration_cli.
  5. Updated the existing test case to validate the trap installation status for the trap being verified with traffic.

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405
  • 202411

Approach

What is the motivation for this PR?

sonic-net/SONiC#1943

How did you do it?

  1. Modified update_copp_config.py script to not modify neighbor_miss trap CBS/CIR values if the platform supports this trap type. This way verification will be able to verify neighbor_miss trap is policed under its own copp but not under default trap.
  2. Updated existing tests to verify the installation status of the trap before performing traffic test for the respective trap.

How did you verify/test it?

Tested by running copp component tests on T0 topology on marvell-teralynx platform.

copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-ARP]PASSED                               [  5%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-IP2ME]PASSED                             [ 10%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-SNMP]PASSED                              [ 15%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-SSH]PASSED                               [ 20%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-DHCP]PASSED                              [ 25%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-DHCP6]PASSED                             [ 30%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-BGP]PASSED                               [ 35%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-LACP]PASSED                              [ 40%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-LLDP]PASSED                              [ 45%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-UDLD] PASSED                             [ 50%]
copp/test_copp.py::TestCOPP::test_policer[str-marvell-01-Default]PASSED                           [ 55%]
copp/test_copp.py::TestCOPP::test_trap_neighbor_miss[4-VlanSubnet-str-marvell-01]PASSED           [ 60%]
copp/test_copp.py::TestCOPP::test_trap_neighbor_miss[4-VlanSubnetIPinIP-str-marvell-01]PASSED     [ 65%]
copp/test_copp.py::TestCOPP::test_trap_neighbor_miss[6-VlanSubnet-str-marvell-01]PASSED           [ 70%]
copp/test_copp.py::TestCOPP::test_trap_neighbor_miss[6-VlanSubnetIPinIP-str-marvell-01]PASSED     [ 75%]
copp/test_copp.py::TestCOPP::test_add_new_trap[str-marvell-01]PASSED                              [ 80%]
copp/test_copp.py::TestCOPP::test_remove_trap[str-marvell-01-delete_feature_entry]PASSED          [ 85%]
copp/test_copp.py::TestCOPP::test_remove_trap[str-marvell-01-disable_feature_status]PASSED        [ 90%]
copp/test_copp.py::TestCOPP::test_trap_config_save_after_reboot[str-marvell-01]PASSED             [ 95%]
copp/test_copp.py::test_verify_copp_configuration_cli[str-marvell-01] PASSED                      [100%]

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

Added test for the following
- If the platform supports neighbor_miss trap, verify Vlan subnet
  traffic is policed under neighbor_miss copp
- Verify 'show copp configuration' CLI output
- Verify trap installation status of configured traps

Signed-off-by: Ravi Minnikanti <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rminnikanti
Copy link
Contributor Author

@prabhataravind @prsunny, please review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants