Skip to content

Adding certz baseline test#5286

Open
ASHNA-AGGARWAL-KEYSIGHT wants to merge 6 commits intoopenconfig:mainfrom
open-traffic-generator:fpt_otg_CERTZ
Open

Adding certz baseline test#5286
ASHNA-AGGARWAL-KEYSIGHT wants to merge 6 commits intoopenconfig:mainfrom
open-traffic-generator:fpt_otg_CERTZ

Conversation

@ASHNA-AGGARWAL-KEYSIGHT
Copy link
Copy Markdown
Contributor

@ASHNA-AGGARWAL-KEYSIGHT ASHNA-AGGARWAL-KEYSIGHT requested a review from a team as a code owner April 1, 2026 15:44
@OpenConfigBot
Copy link
Copy Markdown

OpenConfigBot commented Apr 1, 2026

Pull Request Functional Test Report for #5286 / 80e3ab8

Virtual Devices

Device Test Test Documentation Job Raw Log
Arista cEOS status
Certz-1: gNSI Client Certificate Tests
Cisco 8000E status
Certz-1: gNSI Client Certificate Tests
Cisco XRd status
Certz-1: gNSI Client Certificate Tests
Juniper ncPTX status
Certz-1: gNSI Client Certificate Tests
Nokia SR Linux status
Certz-1: gNSI Client Certificate Tests
Openconfig Lemming status
Certz-1: gNSI Client Certificate Tests

Hardware Devices

Device Test Test Documentation Raw Log
Arista 7808 status
Certz-1: gNSI Client Certificate Tests
Cisco 8808 status
Certz-1: gNSI Client Certificate Tests
Juniper PTX10008 status
Certz-1: gNSI Client Certificate Tests
Nokia 7250 IXR-10e status
Certz-1: gNSI Client Certificate Tests

Help

@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 comprehensive set of baseline tests for the gNSI Certz service. It establishes foundational test cases for managing TLS service profiles on a Device Under Test (DUT), including adding, deleting, and retrieving profile details. Additionally, it provides robust helper functions for generating and cleaning up test certificates and validating the connectivity and functionality of various gRPC services, ensuring the integrity of the certificate management operations.

Highlights

  • gNSI Certz Baseline Tests: Implemented baseline tests for the gNSI Certz service, covering AddProfile, DeleteProfile, and GetProfile RPCs for TLS service profile management.
  • Certificate Management Utilities: Introduced a new setup_service.go utility file to manage certificate test data generation and cleanup, and to validate various gRPC services (gNSI, gNMI, gNOI, gRIBI, P4RT).
  • Test Documentation and Metadata: Added a README.md to document the scope of the Certz baseline tests and metadata.textproto for test identification and testbed configuration.
  • Known Issue for Metric Validation: Noted an open issue (489348277) for the Validate Metrics test, which currently fails intentionally, indicating it is a placeholder or work in progress.
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 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 counter productive. 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.

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 baseline tests for the gNSI certz service, including functionality for adding, deleting, and retrieving TLS service profiles, as well as a placeholder for telemetry validation. The review identified several issues: the getTLSProfileDetailsTest fails to actually invoke the GetProfile RPC, the mismatch parameter is incorrectly handled in VerifyGnoi, the use of global variables in the setupservice package is discouraged, the busy-wait loop in CertzRotate is redundant, and the code uses time.Sleep for configuration propagation instead of the recommended gnmi.Watch with .Await as per the repository style guide.

Comment on lines +153 to +175
func getTLSProfileDetailsTest(t *testing.T, dut *ondatra.DUTDevice) {
ctx, cancel := context.WithTimeout(context.Background(), rpcTimeout)
defer cancel()
certzClient := dut.RawAPIs().GNSI(t).Certz()

_, err := certzClient.AddProfile(ctx, &certzpb.AddProfileRequest{
SslProfileId: testProfile,
})

if err != nil {
// If the profile already exists from a prior run, that is also acceptable.
if st, ok := status.FromError(err); ok && st.Code() == codes.AlreadyExists {
t.Logf("profile %q exists on DUT", testProfile)
}
}

//Get ssl profile list.
if getResp := setupService.GetSslProfilelist(ctx, t, certzClient, &certzpb.GetProfileListRequest{}); slices.Contains(getResp.SslProfileIds, testProfile) {
t.Logf("profile: %s already added.", testProfile)
} else {
t.Errorf("profile: %s not found in profile list", testProfile)
}
}
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.

high

The implementation of getTLSProfileDetailsTest does not actually call the GetProfile RPC, which is what the test name and description imply. It currently only verifies the profile's presence in the list returned by GetProfileList. Please update the test to call GetProfile and validate the returned details.

if err != nil {
// If the profile already exists from a prior run, that is also acceptable.
if st, ok := status.FromError(err); ok && st.Code() == codes.AlreadyExists {
t.Errorf("profile %q already exists on DUT - skipping add", testProfile)
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 comment on line 107 states that the profile already existing is acceptable, but t.Errorf is used here, which will cause the test to fail. If this condition is indeed acceptable, consider using t.Logf instead.

Suggested change
t.Errorf("profile %q already exists on DUT - skipping add", testProfile)
t.Logf("profile %q already exists on DUT - skipping add", testProfile)

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