Skip to content

DP-1.20: Implement QoS ECN negative feature config test - #6319

Open
vjarial-web wants to merge 4 commits into
openconfig:mainfrom
vjarial-web:qos_ecn_negative_config_test_code
Open

vjarial-web wants to merge 4 commits into
openconfig:mainfrom
vjarial-web:qos_ecn_negative_config_test_code

Conversation

@vjarial-web

Copy link
Copy Markdown
Contributor

Description

This PR implements the test code for DP-1.20: QoS ECN negative feature config
(README in #6273).

Changes
feature/qos/tests/qos_ecn_negative_config_test/qos_ecn_negative_config_test.go (new)
Test environment setup: dual-stack interface config on DUT port-1/port-2, queues 0/1, forwarding groups target-group-BE1/target-group-AF1, IPv4/IPv6 DSCP input classifiers attached to both ports, and gNMI Watch verification of classifier attachment.
DP-1.20.1: min-threshold > max-threshold (with output-queue binding in the same Set) is rejected. Skipped on platforms with ecn_min_greater_max_threshold_unsupported.
DP-1.20.2: out-of-range max-drop-probability-percent (101) is rejected.
DP-1.20.3: assigning a non-existent profile (BOGUS_PROFILE) to an output queue is rejected.
DP-1.20.4: deleting an actively applied profile is rejected and the binding remains (verified with gNMI Watch).
DP-1.20.5: detach, delete and revert all setup configuration with gNMI Watch verification; a t.Cleanup safety net restores the DUT if DP-1.20.5 does not complete.
If setup fails, DP-1.20.1 to DP-1.20.5 and DUT cleanup are skipped so a transport error is never counted as a negative-test rejection.
Subtest IDs from the README are used in subtest names, comments and logs.
Uses gnmi.Watch/Await (no time.Sleep) and deviations instead of dut.Vendor() checks.
internal/qoscfg/qoscfg.go: new reusable helpers ECNProfileConfig, BuildECNQueueManagementProfile, VerifyECNQueueManagementProfile, BuildInputClassifierAttachment, VerifyInputClassifier, CleanupQosSetup.
feature/qos/tests/qos_ecn_negative_config_test/metadata.textproto: per-vendor platform_exceptions (Juniper, Nokia, Arista, Cisco) using existing deviations only.

Add qos_ecn_negative_config_test.go implementing the DP-1.20 README
(feature/qos/tests/qos_ecn_negative_config_test/README.md):

- Test environment setup: dual-stack interface config, queues 0/1,
  forwarding groups, IPv4/IPv6 DSCP input classifiers, and gNMI Watch
  verification of classifier attachment.
- DP-1.20.1: reject min-threshold > max-threshold (with queue binding in
  the same Set); skipped via ecn_min_greater_max_threshold_unsupported.
- DP-1.20.2: reject max-drop-probability-percent = 101.
- DP-1.20.3: reject assignment of a non-existent queue-management-profile.
- DP-1.20.4: reject deletion of an actively applied profile and verify
  the binding remains.
- DP-1.20.5: detach, delete, and revert all setup config with gNMI Watch
  verification; t.Cleanup safety net when DP-1.20.5 does not complete.
- Abort DP-1.20.1-DP-1.20.5 (and skip DUT cleanup) if setup fails so a
  transport error is never counted as a negative-test rejection.

Add reusable helpers to internal/qoscfg: ECNProfileConfig,
BuildECNQueueManagementProfile, VerifyECNQueueManagementProfile,
BuildInputClassifierAttachment, VerifyInputClassifier, CleanupQosSetup.

Add per-vendor deviations to metadata.textproto.
@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 introduces a new automated test suite for validating negative QoS ECN configuration scenarios on network devices. The changes include the core test logic, necessary infrastructure helpers for managing QoS profiles and classifiers, and metadata configurations to handle vendor-specific deviations, ensuring robust and portable test execution.

Highlights

  • Test Implementation: Implemented the QoS ECN negative feature configuration test (DP-1.20) covering threshold validation, out-of-range parameters, non-existent profile assignment, and active profile deletion.
  • Reusable Helpers: Added new helper functions in internal/qoscfg/qoscfg.go for ECN profile management, input classifier attachment, and comprehensive QoS setup cleanup.
  • Platform Exceptions: Added metadata.textproto with platform-specific deviations for Juniper, Nokia, Arista, and Cisco to ensure cross-vendor test compatibility.
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

OpenConfigBot commented Nov 23, 2026 •

Copy link
Copy Markdown

Pull Request Functional Test Report for #6319 / 824e32f

Virtual Devices

Device Test Status Test Documentation Job Raw Log
Arista cEOS status
DP-1.20: failure
DP-1.20: QoS ECN negative feature config
ed304fca Log
Cisco 8000E status
DP-1.20: failure
DP-1.20: QoS ECN negative feature config
ad3285f9 Log
Cisco XRd status
DP-1.20: failure
DP-1.20: QoS ECN negative feature config
9db74da6 Log
Juniper ncPTX status
DP-1.20: failure
DP-1.20: QoS ECN negative feature config
88b28cde Log
Nokia SR Linux status
DP-1.20: success
DP-1.20: QoS ECN negative feature config
d3618414 Log
Openconfig Lemming status
DP-1.20: failure
DP-1.20: QoS ECN negative feature config
08204e0e Log

Hardware Devices

Device Test Status Test Documentation Raw Log
Arista status
DP-1.20: pending authorization
DP-1.20: QoS ECN negative feature config
Cisco status
DP-1.20: pending authorization
DP-1.20: QoS ECN negative feature config
Juniper status
DP-1.20: pending authorization
DP-1.20: QoS ECN negative feature config
Nokia status
DP-1.20: pending authorization
DP-1.20: QoS ECN negative feature config

Help

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

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.

Code Review

This pull request introduces a new QoS ECN negative configuration test suite along with corresponding helper functions in the qoscfg package to build, verify, and clean up ECN queue management profiles and classifier attachments. The feedback highlights a critical anti-pattern across several negative test cases where testt.ExpectFatal is incorrectly paired with an unreachable check for an empty error string. To ensure that test failures are correctly reported with custom error messages, these assertions should be refactored to use testt.CaptureFatal and check for a nil pointer instead.

…reads

Some DUTs (e.g. IOS-XR 25.4.x) answer a gNMI Get for an unset config leaf with an update that carries only the parent path and no value, which ygnmi reports as "invalid nil Val in update". Add lookupConfigWithGet to treat that response as the leaf being absent (any other error remains fatal) and use it in ReplaceQueueManagementProfile and the config-polling branch of verifyLeaf.
testt.ExpectFatal fails the subtest itself when no fatal error occurs, so the custom DP-1.20.x error messages were unreachable. Use testt.CaptureFatal and compare the returned *string to nil in DP-1.20.1 through DP-1.20.4. This also lets DP-1.20.4 continue to verify that ECN_VALID_PROFILE remains applied when the delete is unexpectedly accepted.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants