Skip to content

Adding test for TE-14.4#5366

Open
Steubert wants to merge 6 commits intoopenconfig:mainfrom
open-traffic-generator:FPT_OTG_TE-14.4
Open

Adding test for TE-14.4#5366
Steubert wants to merge 6 commits intoopenconfig:mainfrom
open-traffic-generator:FPT_OTG_TE-14.4

Conversation

@Steubert
Copy link
Copy Markdown

@Steubert Steubert requested review from a team as code owners April 20, 2026 15:20
@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 new automated tests for gRIBI scaling and gNSI Certz trust bundle rotation. The changes include a comprehensive test suite for the TE-14.4 scaling target, utilizing shared configuration helpers to manage complex DUT and ATE setups, as well as a robust test for verifying trust bundle rotation under various conditions.

Highlights

  • New gRIBI Scaling Test: Added a new test case for TE-14.4 (gRIBI Scaling - full scale setup, target T2) to validate hierarchical route structures and traffic scenarios.
  • New Trust Bundle Rotation Test: Added a new test for gNSI Certz trust bundle rotation, covering both positive and negative scenarios for RSA and ECDSA key types.
  • Shared Configuration Helpers: Introduced a new shared configuration plugin file to support gRIBI full-scale testing, centralizing topology, programming, and validation logic.
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.

@OpenConfigBot
Copy link
Copy Markdown

OpenConfigBot commented Apr 20, 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 a trust bundle rotation test for GNSI Certz and a full-scale gRIBI scaling test (T2) supported by a new shared configuration plugin. The review identifies several areas for improvement, specifically recommending the removal of global state in table-driven tests to ensure test independence and the elimination of commented-out code. Additionally, the feedback stresses adherence to style guides regarding time.Sleep, the need for robust error handling during entry creation, and refinements to packet validation logic to ensure more reliable and clear testing of network scenarios.

Comment on lines +71 to +73
prevClientCertFile = ""
prevClientKeyFile = ""
prevTrustBundleFile = ""
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

Using global variables to maintain state between test cases in a table-driven loop makes the tests order-dependent and fragile. If a previous test case fails or is skipped, it may leave these variables in an inconsistent state for subsequent tests. Consider passing the state explicitly between functions or managing it within a context object passed through the test cases.

if deviations.InterfaceConfigVRFBeforeAddress(dut) {
t.Log("Configure/update Network Instance type")
dutConfNIPath := d.NetworkInstance(deviations.DefaultNetworkInstance(dut))
gnmi.Replace(t, dut, dutConfNIPath.Type().Config(), oc.NetworkInstanceTypes_NETWORK_INSTANCE_TYPE_DEFAULT_INSTANCE)
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

For consistency and performance, consider adding this configuration to the vrfBatch instead of using gnmi.Replace directly. This ensures all initial configurations are applied in a single transaction where possible.

Suggested change
gnmi.Replace(t, dut, dutConfNIPath.Type().Config(), oc.NetworkInstanceTypes_NETWORK_INSTANCE_TYPE_DEFAULT_INSTANCE)
gnmi.BatchReplace(vrfBatch, dutConfNIPath.Type().Config(), oc.NetworkInstanceTypes_NETWORK_INSTANCE_TYPE_DEFAULT_INSTANCE)

Comment on lines +378 to +379
// ConfigureVRFSelectionPolicy(t, dut)
}
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

Avoid checking in commented-out code that appears to be essential for the test logic. If the VRF selection policy is required but currently causing issues, it should be enabled and the failure tracked via the linked issue, or marked as an expected failure/skipped using appropriate testing primitives.

Comment on lines +644 to +646
// if err := gSession.AwaitTimeout(context.Background(), t, 20*time.Second); err != nil {
// t.Fatalf("gRIBI batch programming failed: %v", err)
// }
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

Commented-out code should be removed to maintain code cleanliness. The accompanying TODO and the workaround already document the issue.

// }
}
// TODO: A time.Sleep is used as a temporary workaround. This will be fixed once the underlying issue is resolved.
time.Sleep(wTime)
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 style guide recommends avoiding time.Sleep and using gnmi.Watch with .Await for waiting on conditions. While gRIBI programming is not directly observable via gNMI Watch, using AwaitTimeout on the gRIBI session is the preferred synchronization mechanism once the underlying bug mentioned in the comments is resolved.

References
  1. Avoid time.Sleep: Use gnmi.Watch with .Await for waiting on conditions. (link)

// BuildStaticGroups generates entries for the two static NHGs (S1 → REPAIR_VRF, S2 → decap DEFAULT).
func BuildStaticGroups(t *testing.T, dut *ondatra.DUTDevice, ctx context.Context, defaultVRF string) (uint64, uint64) {
t.Helper()
s1NHG, s2NHG := StaticS1NHG, StaticS2NHG
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

Errors from gribi.NHEntry and gribi.NHGEntry should be checked to ensure the test fails correctly if entry creation fails, rather than silently ignoring them with _.

Comment thread internal/cfgplugins/gribifullscale.go Outdated
}

for vi, vrf := range encapVRFs {
v4Prefixes, _ := iputil.GenerateIPsWithStep(fmt.Sprintf("200.%d.0.1", vi), NumEncapIPv4PerVRF, CommonPrefixStep)
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

Errors from iputil.GenerateIPsWithStep should be checked to prevent the test from proceeding with invalid or empty prefix lists.

// For Decap (ExpectedOuterSrc == "") this field is left empty and
// the DstIP check inside validateIPv4Header will be skipped because
// the captured decapped packet's dst is the inner-packet's original dst.
DstIP: exp.ExpectedOuterSrc,
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

Repurposing the DstIP field to carry the expected outer-source IP is confusing and potentially incorrect if the underlying validateIPv4Header helper checks this field against the packet's destination IP. It is better to use a field that matches the semantic meaning or extend the helper to support source IP validation.

// the captured decapped packet's dst is the inner-packet's original dst.
DstIP: exp.ExpectedOuterSrc,
Tos: tosByte,
},
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

Spot-checking only the first DSCP value when OTG is configured to cycle through multiple values (SetValues) can lead to flaky test results. If a captured packet happens to have the second DSCP value, the TOS validation will fail. Consider validating against the full set of expected DSCP values.

// and skip DstIP (the decapped dst is the original inner-packet dst, not
// a DUT-stamped tunnel address).
pv.IPv4Layer.SkipProtocolCheck = true
pv.IPv4Layer.DstIP = "" // do not constrain dst for decap
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 destination IP of the decapped packet is known (DecapIPv4InnerDst). It should be validated here to ensure the packet was correctly decapped and forwarded to the expected inner destination, rather than leaving the constraint empty.

Suggested change
pv.IPv4Layer.DstIP = "" // do not constrain dst for decap
pv.IPv4Layer.DstIP = DecapIPv4InnerDst

@ksgireesha ksgireesha requested a review from gggsmith April 21, 2026 04:37
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