Skip to content

Adding test for AFT-6.2#5523

Open
Steubert wants to merge 2 commits into
openconfig:mainfrom
open-traffic-generator:FPT_OTG_AFT-6.2
Open

Adding test for AFT-6.2#5523
Steubert wants to merge 2 commits into
openconfig:mainfrom
open-traffic-generator:FPT_OTG_AFT-6.2

Conversation

@Steubert Steubert requested review from a team as code owners May 29, 2026 14:18
@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 test case for AFT-6.2, focusing on dual-stack prefix filtering within the AFT (Abstract Forwarding Table). It includes the necessary test logic to configure routing policies, static routes, and verify filtering outcomes. Additionally, it adds infrastructure support for platform-specific deviations, allowing the test to run on hardware that requires CLI-based configuration for global filter policies instead of standard gNMI/OpenConfig paths.

Highlights

  • New Test Implementation: Added a new test suite to validate AFT-6.2: AFT Prefix Filtering Dual-Stack, ensuring correct filtering behavior for both IPv4 and IPv6 prefixes.
  • Infrastructure Support: Introduced a new deviation 'afts_global_filter_policy_oc_unsupported' to handle platforms (like Arista) that do not support the standard OpenConfig path for AFT global filter policies.
  • Policy Swap Validation: Implemented verification for cross-family policy swap behavior, ensuring that prefix filtering updates are correctly applied and reflected in the AFT state.
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.

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 implements the AFT Prefix Filtering Dual-Stack test (AFT-6.2), adding a new test file, metadata, and a deviation for Arista devices where the AFT global filter policy OC path is unsupported. The feedback recommends replacing t.Context() with context.Background() for Go compatibility, verifying IPv6 prefixes directly from the streamed prefixes rather than querying the DUT state, optimizing the state polling loop using gnmiC.Get instead of repeated ONCE subscriptions, and reusing existing sessions to verify prefix deletion. Additionally, the deviation comment should be updated to fix a path typo and include the required issue tracker URL tracking its removal.

Comment on lines +540 to +543
// Open a new subscription and verify matched prefixes are removed.
t.Log("Step 7: Opening AFT subscription with swapped policy")
session1Swapped, session2Swapped, stoppingCondSwapped := mustOpenAFTSessions(t, dut, map[string]bool{})
aftSwapped := mustRunAFTSessions(t, aftSessionConfig{session1: session1Swapped, session2: session2Swapped, stop: stoppingCondSwapped, dut: 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

Opening a new gNMI subscription to verify that prefixes are removed is inefficient and adds unnecessary overhead. Since the existing sessions (session1 and session2) are ON_CHANGE subscriptions, they will automatically receive delete notifications when the policy is swapped. You can reuse the existing sessions and use aftcache.DeletionStoppingCondition to verify that the prefixes are deleted. This is faster, more efficient, and directly validates the deletion streaming behavior of the existing subscription.

Suggested change
// Open a new subscription and verify matched prefixes are removed.
t.Log("Step 7: Opening AFT subscription with swapped policy")
session1Swapped, session2Swapped, stoppingCondSwapped := mustOpenAFTSessions(t, dut, map[string]bool{})
aftSwapped := mustRunAFTSessions(t, aftSessionConfig{session1: session1Swapped, session2: session2Swapped, stop: stoppingCondSwapped, dut: dut})
// Verify prefixes are deleted from the existing AFT stream.
t.Log("Step 7: Verifying prefixes are deleted from the existing AFT stream")
stopDelete := aftcache.DeletionStoppingCondition(t, dut, wantPrefixes)
aftSwapped := mustRunAFTSessions(t, aftSessionConfig{session1: session1, session2: session2, stop: stopDelete, dut: dut})

Comment thread internal/deviations/deviations.go
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