Skip to content

Codex/hammadkh/aft typed bindings public 20261120 - #6310

Open
hmod2001 wants to merge 8 commits into
openconfig:mainfrom
b4firex:codex/hammadkh/aft-typed-bindings-public-20261120
Open

hmod2001 wants to merge 8 commits into
openconfig:mainfrom
b4firex:codex/hammadkh/aft-typed-bindings-public-20261120

Conversation

@hmod2001

@hmod2001 hmod2001 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Updates AFT-6.1–6.4 for Cisco IOS XR and replaces handwritten global-filter configuration and readback with generated Ondatra bindings.

  • AFT-6.1: Fixes policy references, deletion and modification checks. Cisco’s empty-view check uses a drop policy; tag matching remains untested.
  • AFT-6.2: Fixes dual-stack policy transitions and withdrawal checks while allowing default routes required for next-hop resolution.
  • AFT-6.3: Fixes reboot/BGP recovery, connection refresh, concurrent scale collection, per-VRF isolation and IPv6 neighbor identity checks.
  • AFT-6.4: Fixes dynamic prefix-policy updates and neighbor resolution.

Shared changes address notification deletion handling and Cisco VRF next-hop scoping. The public B4FireX Ondatra dependency supplies the OpenConfig 5.11 global-filter bindings. Requires Go 1.26.3.

Validation

All four suites compiled. Binding-contract checks and 26 focused regression cases passed. Earlier SIM runs used the external B4 timing overlay.

Pin the public OpenConfig 5.11 global-filter regeneration and use typed policy configuration, deletion and CONFIG/STATE reads. Preserve batching, Cisco JSON_IETF encoding and fresh reconnect transports.

Include the wire-contract check and Jenkins reproduction instructions. AFT-6.1 passed all seven groups and four prefix variants from the prepared public checkout; all four AFT binaries compiled.
@hmod2001
hmod2001 requested review from a team as code owners November 20, 2026 22:19
@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 completes the migration of AFT filtered-streaming tests to use typed Ondatra OpenConfig bindings. It carries forward critical filtering fixes required for Cisco IOS XR, ensuring consistent test behavior across vendors. The changes include updated test implementations, shared collector improvements, and robust diagnostic capabilities to facilitate future debugging and validation.

Highlights

  • Typed Ondatra Bindings: Migrated global-filter configuration paths from handwritten JSON construction to generated Ondatra OpenConfig bindings, improving type safety and maintainability.
  • Cisco IOS XR Compatibility: Integrated fixes for Cisco-specific behaviors, including support for unconditional drop policies, atomic deletion handling, and timing adjustments for simulator environments.
  • Dependency Updates: Pinned a public Ondatra fork to support missing global-filter YANG models and updated Go to 1.26.3 along with related dependencies like KNE and gRPC.
  • Diagnostic Improvements: Added comprehensive AFT diagnostic tools, including CLI command capture and independent gNMI readbacks, to assist in troubleshooting complex filtering scenarios.
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. ↩

@OpenConfigBot

OpenConfigBot commented Nov 20, 2026 •

Copy link
Copy Markdown

Pull Request Functional Test Report for #6310 / f29355a

Virtual Devices

Device Test Status Test Documentation Job Raw Log
Arista cEOS status
status
status
status
AFT-6.1: pending authorization
AFT-6.2: pending authorization
AFT-6.4: pending authorization
AFT-6.3: pending authorization
AFT-6.1: AFT Prefix Filtering
AFT-6.2: AFT Prefix Filtering Dual-Stack
AFT-6.4: AFT Prefix Filtering Dynamic Updates
AFT-6.3: AFT Prefix Filtering Resilience
Cisco 8000E status
status
status
status
AFT-6.1: pending authorization
AFT-6.2: pending authorization
AFT-6.4: pending authorization
AFT-6.3: pending authorization
AFT-6.1: AFT Prefix Filtering
AFT-6.2: AFT Prefix Filtering Dual-Stack
AFT-6.4: AFT Prefix Filtering Dynamic Updates
AFT-6.3: AFT Prefix Filtering Resilience
Cisco XRd status
status
status
status
AFT-6.1: pending authorization
AFT-6.2: pending authorization
AFT-6.4: pending authorization
AFT-6.3: pending authorization
AFT-6.1: AFT Prefix Filtering
AFT-6.2: AFT Prefix Filtering Dual-Stack
AFT-6.4: AFT Prefix Filtering Dynamic Updates
AFT-6.3: AFT Prefix Filtering Resilience
Juniper ncPTX status
status
status
status
AFT-6.1: pending authorization
AFT-6.2: pending authorization
AFT-6.4: pending authorization
AFT-6.3: pending authorization
AFT-6.1: AFT Prefix Filtering
AFT-6.2: AFT Prefix Filtering Dual-Stack
AFT-6.4: AFT Prefix Filtering Dynamic Updates
AFT-6.3: AFT Prefix Filtering Resilience
Nokia SR Linux status
status
status
status
AFT-6.1: pending authorization
AFT-6.2: pending authorization
AFT-6.4: pending authorization
AFT-6.3: pending authorization
AFT-6.1: AFT Prefix Filtering
AFT-6.2: AFT Prefix Filtering Dual-Stack
AFT-6.4: AFT Prefix Filtering Dynamic Updates
AFT-6.3: AFT Prefix Filtering Resilience
Openconfig Lemming status
status
status
status
AFT-6.1: pending authorization
AFT-6.2: pending authorization
AFT-6.4: pending authorization
AFT-6.3: pending authorization
AFT-6.1: AFT Prefix Filtering
AFT-6.2: AFT Prefix Filtering Dual-Stack
AFT-6.4: AFT Prefix Filtering Dynamic Updates
AFT-6.3: AFT Prefix Filtering Resilience

Hardware Devices

Device Test Status Test Documentation Raw Log
Arista status
status
status
status
AFT-6.1: pending authorization
AFT-6.2: pending authorization
AFT-6.4: pending authorization
AFT-6.3: pending authorization
AFT-6.1: AFT Prefix Filtering
AFT-6.2: AFT Prefix Filtering Dual-Stack
AFT-6.4: AFT Prefix Filtering Dynamic Updates
AFT-6.3: AFT Prefix Filtering Resilience
Cisco status
status
status
status
AFT-6.1: pending authorization
AFT-6.2: pending authorization
AFT-6.4: pending authorization
AFT-6.3: pending authorization
AFT-6.1: AFT Prefix Filtering
AFT-6.2: AFT Prefix Filtering Dual-Stack
AFT-6.4: AFT Prefix Filtering Dynamic Updates
AFT-6.3: AFT Prefix Filtering Resilience
Juniper status
status
status
status
AFT-6.1: pending authorization
AFT-6.2: pending authorization
AFT-6.4: pending authorization
AFT-6.3: pending authorization
AFT-6.1: AFT Prefix Filtering
AFT-6.2: AFT Prefix Filtering Dual-Stack
AFT-6.4: AFT Prefix Filtering Dynamic Updates
AFT-6.3: AFT Prefix Filtering Resilience
Nokia status
status
status
status
AFT-6.1: pending authorization
AFT-6.2: pending authorization
AFT-6.4: pending authorization
AFT-6.3: pending authorization
AFT-6.1: AFT Prefix Filtering
AFT-6.2: AFT Prefix Filtering Dual-Stack
AFT-6.4: AFT Prefix Filtering Dynamic Updates
AFT-6.3: AFT Prefix Filtering Resilience

Help

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request transitions the AFT prefix filtering tests (AFT-6.1 through AFT-6.4) to use typed Ondatra and ygnmi bindings instead of raw gNMI paths. It introduces platform exceptions and robust diagnostic helpers to accommodate Cisco IOS XR limitations, such as replacing complete prefix-sets and using BGP-origin AFT summaries for VRF convergence. The review feedback highlights critical improvements: replacing t.Logf calls in asynchronous background goroutines within aft_cache.go to prevent flaky test panics, and replacing several usages of context.Background() with t.Context() in gNMI operations to ensure proper timeout and cancellation handling.

Comment on lines +551 to +573
if err != nil {
counters.receiveFailure.Store(&aftSubscriptionResponse{err: err})
if ctx.Err() == nil {
// Record the client queue at the actual receive failure,
// before its error waits behind any buffered notifications.
// This is not the DUT's MDT destination queue.
t.Logf("DUT %s NI=%s AFT stream receive failed UTC=%s: %v; CLIENT buffered notifications=%d/%d received=%d processed=%d (not the DUT queue)",
dut.Name(), networkInstance, time.Now().UTC().Format(time.RFC3339Nano), err,
len(buffer), cap(buffer), counters.received.Load(), counters.processed.Load())
select {
case buffer <- &aftSubscriptionResponse{err: err}:
case <-ctx.Done():
}
}
return
}
counters.received.Add(1)
counters.lastReceived.Store(time.Now().UnixNano())
if n.GetSyncResponse() {
counters.syncReceived.Add(1)
t.Logf("DUT %s gNMI AFT SyncResponse arrived; buffered notifications=%d/%d",
dut.Name(), len(buffer), cap(buffer))
}

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

Calling t.Logf inside an asynchronous background goroutine is a known anti-pattern in Go tests. If the test finishes or is cancelled while the background goroutine is still receiving messages or handling errors, calling t.Logf will cause a panic (testing: t.Logf called after Test... has finished), leading to flaky test failures. Since these events are already logged or tracked via ss.Progress() and ListenUntil, we should safely remove these asynchronous logging calls.

			if err != nil {
				counters.receiveFailure.Store(&aftSubscriptionResponse{err: err})
				if ctx.Err() == nil {
					select {
					case buffer <- &aftSubscriptionResponse{err: err}:
					case <-ctx.Done():
					}
				}
				return
			}
			counters.received.Add(1)
			counters.lastReceived.Store(time.Now().UnixNano())
			if n.GetSyncResponse() {
				counters.syncReceived.Add(1)
			}

t.Logf("Sending typed AFT global-filter Set batch: %s", batch)
started := time.Now()
t.Logf("AFT global-filter Set start: UTC=%s NI=%s client=%p createdUTC=%s", started.UTC().Format(time.RFC3339Nano), cfg.VRFName, client, createdAt.UTC().Format(time.RFC3339Nano))
response, err := batch.Set(context.Background(), typedClient, ygnmi.WithEncoding(ConfigEncoding(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

Using context.Background() for gNMI operations in tests can cause the test to hang indefinitely if the gNMI server blocks or fails to respond. Since t.Context() is available, we should use it to ensure proper cancellation and timeout handling when the test finishes or is interrupted.

Suggested change
response, err := batch.Set(context.Background(), typedClient, ygnmi.WithEncoding(ConfigEncoding(dut)))
response, err := batch.Set(t.Context(), typedClient, ygnmi.WithEncoding(ConfigEncoding(dut)))

batch := &ygnmi.SetBatch{}
ygnmi.BatchDelete(batch, filter.Ipv4Policy().Config())
ygnmi.BatchDelete(batch, filter.Ipv6Policy().Config())
_, err = batch.Set(context.Background(), client)

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 context.Background() for gNMI operations in tests can cause the test to hang indefinitely if the gNMI server blocks or fails to respond. Since t.Context() is available, we should use it to ensure proper cancellation and timeout handling when the test finishes or is interrupted.

Suggested change
_, err = batch.Set(context.Background(), client)
_, err = batch.Set(t.Context(), client)

req := &gpb.SetRequest{Update: updates}
_, setErr := client.Set(context.Background(), req)
t.Logf("Sending typed AFT global-filter negative-check Set batch: %s", batch)
_, setErr := batch.Set(context.Background(), client, ygnmi.WithEncoding(aftpf.ConfigEncoding(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

Using context.Background() for gNMI operations in tests can cause the test to hang indefinitely if the gNMI server blocks or fails to respond. Since t.Context() is available, we should use it to ensure proper cancellation and timeout handling when the test finishes or is interrupted.

Suggested change
_, setErr := batch.Set(context.Background(), client, ygnmi.WithEncoding(aftpf.ConfigEncoding(dut)))
_, setErr := batch.Set(t.Context(), client, ygnmi.WithEncoding(aftpf.ConfigEncoding(dut)))

}
req := &gpb.SetRequest{Delete: []*gpb.Path{policyDefinitionPath(policyName)}}
t.Logf("Sending policy-definition delete gNMI SetRequest: %v", req)
_, setErr := client.Set(context.Background(), req)

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 context.Background() for gNMI operations in tests can cause the test to hang indefinitely if the gNMI server blocks or fails to respond. Since t.Context() is available, we should use it to ensure proper cancellation and timeout handling when the test finishes or is interrupted.

Suggested change
_, setErr := client.Set(context.Background(), req)
_, setErr := client.Set(t.Context(), req)

ygnmi.BatchDelete(batch, filter.Ipv4Policy().Config())
ygnmi.BatchDelete(batch, filter.Ipv6Policy().Config())
ygnmi.BatchDelete(batch, gnmi.OC().RoutingPolicy().PolicyDefinition(policyName).Config())
if _, err := batch.Set(context.Background(), client); err != nil {

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 context.Background() for gNMI operations in tests can cause the test to hang indefinitely if the gNMI server blocks or fails to respond. Since t.Context() is available, we should use it to ensure proper cancellation and timeout handling when the test finishes or is interrupted.

Suggested change
if _, err := batch.Set(context.Background(), client); err != nil {
if _, err := batch.Set(t.Context(), client); err != nil {

if _, err := client.Set(context.Background(), req); err != nil {
started := time.Now()
t.Logf("Sending prefix-set reference gNMI SetRequest UTC=%s: %v", started.UTC().Format(time.RFC3339Nano), req)
response, setErr := client.Set(context.Background(), req)

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 context.Background() for gNMI operations in tests can cause the test to hang indefinitely if the gNMI server blocks or fails to respond. Since t.Context() is available, we should use it to ensure proper cancellation and timeout handling when the test finishes or is interrupted.

Suggested change
response, setErr := client.Set(context.Background(), req)
response, setErr := client.Set(t.Context(), req)

Recognize TenGigE as Te in the strict native IPv6 ND fallback and add parser regression coverage. Poll AFT-6.3 collector conditions every five seconds so initial sync cannot race its two-minute deadline. Preserve exact peer identity, existing deadlines and forwarding assertions.
Recognize XR's Hu abbreviation while preserving the existing Te/FH mappings and exact address, full port suffix and MAC validation. Add eight HundredGigE regression cases alongside the thirteen existing parser cases; update the reproduction note.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants