Fix ACCTZ-1.1 and ACCTZ-2.1 fail gRPC auth regression - #5796
Conversation
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 addresses a regression in gRPC authentication testing that caused authorization failures on Cisco IOS-XR devices. By reverting to the correct test password and implementing a more flexible error validation mechanism, the changes ensure that authentication-based tests correctly identify denied access across different vendor platforms. 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
|
There was a problem hiding this comment.
Code Review
This pull request refactors the acctz package by correcting password variable assignments and consolidating repetitive gRPC error-checking logic into a new helper function, logExpectedFailGRPCError. The review feedback correctly identifies a critical issue in this helper: for non-Arista platforms, if a gRPC call unexpectedly succeeds with bad credentials (i.e., err is nil), the helper only logs the event instead of failing the test. This would allow tests to silently pass despite authentication failures. A code suggestion has been provided to change this to a test error.
Summary
Fixes ACCTZ-1.1 (
record_subscribe_full) and ACCTZ-2.1 (record_subscribe_partial) failures on Cisco IOS-XR caused by a regression in fail gRPC RPC handling.PR #5309 changed fail gRPC calls to use
failPassword("baggins"), which is the same password Credentialz configures on the DUT for userbilbo. As a result, fail RPCs authenticated successfully and acctz recordedAUTHZ_STATUS_PERMITinstead of the expectedAUTHZ_STATUS_DENY.This change restores the prior behavior:
failAuthenticatePassword("bagginsTest123!") for fail gRPC RPCs on non-Arista platforms so authentication fails as intended.logExpectedFailGRPCError()for vendor-specific error validation:codes.PermissionDenied(authorization deny viafailauthuser)Unauthenticated)Root cause
"bagginsTest123!""baggins"(matches DUT)UnauthenticatedDENYPERMIT