Skip to content

SYS-1.1 Add strata platform support to default_copp_test#5460

Open
keil-arista wants to merge 2 commits into
openconfig:mainfrom
keil-arista:arPlatSys1_1
Open

SYS-1.1 Add strata platform support to default_copp_test#5460
keil-arista wants to merge 2 commits into
openconfig:mainfrom
keil-arista:arPlatSys1_1

Conversation

@keil-arista
Copy link
Copy Markdown

The default_copp_test hardcodes "sand" in the OpenConfig vendor path and uses sand-specific counter names. Strata platform devices (e.g. DCS-7050CX4M-48D8-F) require different counter names and a different vendor path element. This change detects the platform dynamically from the gNMI response and selects the appropriate counter mapping.

L2 unicast CoPP tests are skipped on strata platforms via a new deviation because strata drops L2 packets destined to the system MAC in the pipeline before they reach the CPU.

  • (M) feature/system/control_plane_traffic/otg_tests/default_copp_test/default_copp_test.go
    • Add platformConfig struct and counter name maps for sand vs strata.
    • Detect platform dynamically from gNMI Get response on the vendor path.
    • Replace hardcoded "sand" path element with detected platform name.
    • Skip L2 unicast test cases on strata via CoppL2UnicastUnsupported deviation.
  • (M) feature/system/control_plane_traffic/otg_tests/default_copp_test/metadata.textproto
    • Add hardware_model_regex to existing Arista sand platform_exceptions entry.
    • Add new platform_exceptions entry for strata (DCS-7050CX4.*) with copp_l2_unicast_unsupported deviation.
  • (M) proto/metadata.proto
    • Add copp_l2_unicast_unsupported deviation field (422).
  • (M) proto/metadata_go_proto/metadata.pb.go
    • Regenerated from metadata.proto.
  • (M) internal/deviations/deviations.go
    • Add CoppL2UnicastUnsupported accessor.

The default_copp_test hardcodes "sand" in the OpenConfig vendor path and
uses sand-specific counter names. Strata platform devices (e.g.
DCS-7050CX4M-48D8-F) require different counter names and a different
vendor path element. This change detects the platform dynamically from
the gNMI response and selects the appropriate counter mapping.

L2 unicast CoPP tests are skipped on strata platforms via a new
deviation because strata drops L2 packets destined to the system MAC
in the pipeline before they reach the CPU.

* (M) feature/system/control_plane_traffic/otg_tests/default_copp_test/default_copp_test.go
  - Add platformConfig struct and counter name maps for sand vs strata.
  - Detect platform dynamically from gNMI Get response on the vendor path.
  - Replace hardcoded "sand" path element with detected platform name.
  - Skip L2 unicast test cases on strata via CoppL2UnicastUnsupported deviation.
* (M) feature/system/control_plane_traffic/otg_tests/default_copp_test/metadata.textproto
  - Add hardware_model_regex to existing Arista sand platform_exceptions entry.
  - Add new platform_exceptions entry for strata (DCS-7050CX4.*) with
    copp_l2_unicast_unsupported deviation.
* (M) proto/metadata.proto
  - Add copp_l2_unicast_unsupported deviation field (422).
* (M) proto/metadata_go_proto/metadata.pb.go
  - Regenerated from metadata.proto.
* (M) internal/deviations/deviations.go
  - Add CoppL2UnicastUnsupported accessor.
@keil-arista keil-arista requested review from a team as code owners May 13, 2026 20:32
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the default_copp_test to support the Strata platform alongside the existing Sand platform. By dynamically detecting the hardware platform via gNMI, the test now correctly selects the appropriate counter mappings for control plane traffic. Additionally, it introduces a new deviation to gracefully handle platform-specific limitations where L2 unicast packets are dropped before reaching the CPU, ensuring test reliability across different Arista hardware models.

Highlights

  • Dynamic Platform Detection: Implemented dynamic platform detection for the default_copp_test by querying the gNMI vendor path, allowing the test to switch between 'sand' and 'strata' counter mappings automatically.
  • Strata Platform Support: Added specific counter name mappings for the Strata platform and introduced a new deviation, 'CoppL2UnicastUnsupported', to skip L2 unicast CoPP tests on these devices.
  • Metadata Updates: Updated metadata.textproto to include hardware model regex for Arista sand and strata platforms, and added the new deviation field to the metadata protocol buffers.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@OpenConfigBot
Copy link
Copy Markdown

OpenConfigBot commented May 13, 2026

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces platform-specific COPP (Control Plane Policing) counter validation by dynamically detecting the platform type and mapping logical counters to platform-specific names. It also adds a new deviation, CoppL2UnicastUnsupported, to handle hardware that does not support L2 unicast counter validation. Feedback includes a requirement to add issue tracker links to deviation functions per the style guide, and recommendations to use the test context in gNMI requests within helper functions to ensure proper timeout and cancellation handling.

Comment on lines +2182 to +2183
// CoppL2UnicastUnsupported returns true if the device does not support L2 unicast COPP counter validation.
func CoppL2UnicastUnsupported(dut *ondatra.DUTDevice) bool {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The deviation accessor function is missing a comment with a URL link to an issue tracker, which is required by the repository style guide.

Suggested change
// CoppL2UnicastUnsupported returns true if the device does not support L2 unicast COPP counter validation.
func CoppL2UnicastUnsupported(dut *ondatra.DUTDevice) bool {
// CoppL2UnicastUnsupported returns true if the device does not support L2 unicast COPP counter validation.
// https://issuetracker.google.com/issues/xxxxx
func CoppL2UnicastUnsupported(dut *ondatra.DUTDevice) bool {
References
  1. Add a comment to the accessor function containing a URL link to an issue tracker which tracks removal of the deviation. The format should be https://issuetracker.google.com/issues/xxxxx. (link)

Comment on lines +160 to +162
func getPlatformConfig(t *testing.T, gnmiClient gpb.GNMIClient) *platformConfig {
t.Helper()
resp, err := gnmiClient.Get(context.Background(), &gpb.GetRequest{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

It is recommended to pass the test context to getPlatformConfig and use it in the gNMI Get request instead of context.Background(). This ensures that the gNMI operation respects the test's timeout and cancellation. Additionally, ensure t.Helper() is called as the first statement in the helper function.

Suggested change
func getPlatformConfig(t *testing.T, gnmiClient gpb.GNMIClient) *platformConfig {
t.Helper()
resp, err := gnmiClient.Get(context.Background(), &gpb.GetRequest{
func getPlatformConfig(t *testing.T, ctx context.Context, gnmiClient gpb.GNMIClient) *platformConfig {
t.Helper()
resp, err := gnmiClient.Get(ctx, &gpb.GetRequest{
References
  1. Helper functions that report test errors should call t.Helper() as the first statement to ensure error logs point to the caller's location.

return
}

platCfg := getPlatformConfig(t, gnmiClient)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Pass the test context ctx to getPlatformConfig.

Suggested change
platCfg := getPlatformConfig(t, gnmiClient)
platCfg := getPlatformConfig(t, ctx, gnmiClient)

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