Repository navigation
DP-1.20: Implement QoS ECN negative feature config test - #6319
vjarial-web wants to merge 4 commits into
Conversation
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.
Summary of ChangesHello, 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
Using Gemini Code AssistThe 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
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 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
|
Pull Request Functional Test Report for #6319 / 824e32fVirtual Devices
Hardware Devices
|
There was a problem hiding this comment.
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.
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.