Skip to content

BGP OC uprev test changes in RT-1.2, RT-1.27, RT-1.29, RT-1.30, RT-1.32, RT-7.8, RT-7.10, RT-7.11, and gNMI-1.3 - #6031

Open
LiamWalsh98 wants to merge 10 commits into
openconfig:mainfrom
b4firex:bgp-oc-yml-bgp-uprev-fnts
Open

BGP OC uprev test changes in RT-1.2, RT-1.27, RT-1.29, RT-1.30, RT-1.32, RT-7.8, RT-7.10, RT-7.11, and gNMI-1.3#6031
LiamWalsh98 wants to merge 10 commits into
openconfig:mainfrom
b4firex:bgp-oc-yml-bgp-uprev-fnts

Conversation

@LiamWalsh98

@LiamWalsh98 LiamWalsh98 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR updates nine FNTs for the current BGP OpenConfig model.

The changes update send-community paths, import/export policy replacement, and MED actions. The PR also includes test-specific reliability changes.

OpenConfig path changes

Peer-group send-community configuration

Previous root leaves:

/network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/config/send-community

/network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/config/send-community-type

Current AFI-SAFI leaf:

/network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/config/send-community-type

Neighbor send-community configuration

Previous root leaf:

/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/config/send-community-type

Current AFI-SAFI leaf:

/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/config/send-community-type

Import/export policy root replacement

Previous operation:

  • Replace or delete only .../apply-policy/config/import-policy or .../apply-policy/config/export-policy.

Current operation:

  • Read the containing .../apply-policy/config root.
  • Change import-policy or export-policy in the returned configuration.
  • Replace the complete .../apply-policy/config root.

MED actions

The tests continue to set the MED value at:

/routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-med

The tests now set the related operation at:

/routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-med-action

The tests use SET for assignment. RT-1.32 also uses ADD for its additive MED case.

IS-IS authentication in gNMI-1.3

Previous level path:

/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/hello-authentication/config

Current interface path for the applicable platform exception:

/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/authentication/config

This compatibility change is not related to the BGP OpenConfig uprev.

Removed deviation assignments

The PR removes these suite metadata assignments:

  • bgp_set_med_action_unsupported: gNMI-1.3, RT-1.2, RT-1.27, RT-1.29, RT-1.30, RT-1.32, and RT-7.11.
  • skip_bgp_send_community_type: RT-1.27, RT-7.8, and RT-7.11.
  • skip_bgp_peer_group_send_community_type: RT-1.27.
  • bgp_community_type_slice_input_unsupported: RT-7.10.

Affected FNTs

RT-1.2

  • Pairs set-med with set-med-action: SET and waits for IPv4/IPv6 neighbor resolution before BGP peer checks.

RT-1.27

  • Moves send-community-type: STANDARD from the global AFI-SAFI to the peer-group IPv4/IPv6 AFI-SAFIs, pairs set-med with set-med-action: SET, and replaces the complete table-connection root when clearing import-policy.
  • Makes OTG route-attribute checks tolerant of delayed or absent telemetry and extends the send-community validation watch to 30 seconds.

RT-1.29

  • Replaces complete neighbor AFI-SAFI import/export policy roots, preserves required siblings, and pairs set-med with set-med-action: SET.
  • Retains the existing flattened-policy and skipped-statement vendor paths at their required scopes.

RT-1.30

  • Replaces complete IPv4/IPv6 neighbor AFI-SAFI import/export policy roots and pairs set-med with set-med-action: SET.

RT-1.32

  • Replaces complete neighbor AFI-SAFI import/export policy roots while preserving default-policy values; removes an empty root during cleanup.
  • Uses set-med-action: SET for MED assignment and ADD for MED increments.

RT-7.8

  • Configures peer-group AFI-SAFI send-community-type: STANDARD and replaces complete neighbor or peer-group AFI-SAFI import/export policy roots.

RT-7.10

  • Moves send-community-type: STANDARD from the peer-group root to the IPv4 peer-group AFI-SAFI.

RT-7.11

  • Replaces complete neighbor AFI-SAFI import/export policy roots, configures AFI-SAFI send-community-type: STANDARD and EXTENDED, and pairs set-med with set-med-action: SET.
  • Builds flows before one OTG protocol start, waits for the exact BGP peers, and removes the redundant restart and fixed delay.

gNMI-1.3

  • Replaces complete peer-group import/export policy roots, removes a redundant import-policy write, and pairs set-med with set-med-action: SET.
  • Uses interface-level IS-IS authentication for set_isis_auth_with_interface_authentication_container; this is a compatibility fix from a different OC uprev, but gnmi-1.3 is affected by both.

@LiamWalsh98
LiamWalsh98 requested review from a team as code owners September 11, 2026 22:58
@OpenConfigBot

OpenConfigBot commented Sep 11, 2026

Copy link
Copy Markdown

Pull Request Functional Test Report for #6031 / f03ad3c

Virtual Devices

Device Test Test Documentation Job Raw Log
Arista cEOS status
status
status
status
status
status
status
status
status
RT-1.27: Static route to BGP redistribution
RT-7.11: BGP Policy - Import/Export Policy Action Using Multiple Criteria
RT-1.30: BGP nested import/export policy attachment
gNMI-1.3: Benchmarking: Drained Configuration Convergence Time
RT-1.32: BGP policy actions - MED, LocPref, prepend, flow-control
RT-1.29: BGP chained import/export policy attachment
RT-7.8: BGP Policy Match Standard Community and Add Community Import/Export Policy
RT-1.2: BGP Policy & Route Installation
RT-7.10: Routing policy statement insertion and removal
Cisco 8000E status
status
status
status
status
status
status
status
status
RT-1.27: Static route to BGP redistribution
RT-7.11: BGP Policy - Import/Export Policy Action Using Multiple Criteria
RT-1.30: BGP nested import/export policy attachment
gNMI-1.3: Benchmarking: Drained Configuration Convergence Time
RT-1.32: BGP policy actions - MED, LocPref, prepend, flow-control
RT-1.29: BGP chained import/export policy attachment
RT-7.8: BGP Policy Match Standard Community and Add Community Import/Export Policy
RT-1.2: BGP Policy & Route Installation
RT-7.10: Routing policy statement insertion and removal
Cisco XRd status
status
status
status
status
status
status
status
status
RT-1.27: Static route to BGP redistribution
RT-7.11: BGP Policy - Import/Export Policy Action Using Multiple Criteria
RT-1.30: BGP nested import/export policy attachment
gNMI-1.3: Benchmarking: Drained Configuration Convergence Time
RT-1.32: BGP policy actions - MED, LocPref, prepend, flow-control
RT-1.29: BGP chained import/export policy attachment
RT-7.8: BGP Policy Match Standard Community and Add Community Import/Export Policy
RT-1.2: BGP Policy & Route Installation
RT-7.10: Routing policy statement insertion and removal
Juniper ncPTX status
status
status
status
status
status
status
status
status
RT-1.27: Static route to BGP redistribution
RT-7.11: BGP Policy - Import/Export Policy Action Using Multiple Criteria
RT-1.30: BGP nested import/export policy attachment
gNMI-1.3: Benchmarking: Drained Configuration Convergence Time
RT-1.32: BGP policy actions - MED, LocPref, prepend, flow-control
RT-1.29: BGP chained import/export policy attachment
RT-7.8: BGP Policy Match Standard Community and Add Community Import/Export Policy
RT-1.2: BGP Policy & Route Installation
RT-7.10: Routing policy statement insertion and removal
Nokia SR Linux status
status
status
status
status
status
status
status
status
RT-1.27: Static route to BGP redistribution
RT-7.11: BGP Policy - Import/Export Policy Action Using Multiple Criteria
RT-1.30: BGP nested import/export policy attachment
gNMI-1.3: Benchmarking: Drained Configuration Convergence Time
RT-1.32: BGP policy actions - MED, LocPref, prepend, flow-control
RT-1.29: BGP chained import/export policy attachment
RT-7.8: BGP Policy Match Standard Community and Add Community Import/Export Policy
RT-1.2: BGP Policy & Route Installation
RT-7.10: Routing policy statement insertion and removal
Openconfig Lemming status
status
status
status
status
status
status
status
status
RT-1.27: Static route to BGP redistribution
RT-7.11: BGP Policy - Import/Export Policy Action Using Multiple Criteria
RT-1.30: BGP nested import/export policy attachment
gNMI-1.3: Benchmarking: Drained Configuration Convergence Time
RT-1.32: BGP policy actions - MED, LocPref, prepend, flow-control
RT-1.29: BGP chained import/export policy attachment
RT-7.8: BGP Policy Match Standard Community and Add Community Import/Export Policy
RT-1.2: BGP Policy & Route Installation
RT-7.10: Routing policy statement insertion and removal

Hardware Devices

Device Test Test Documentation Raw Log
Arista status
status
status
status
status
status
status
status
status
RT-1.27: Static route to BGP redistribution
RT-7.11: BGP Policy - Import/Export Policy Action Using Multiple Criteria
RT-1.30: BGP nested import/export policy attachment
gNMI-1.3: Benchmarking: Drained Configuration Convergence Time
RT-1.32: BGP policy actions - MED, LocPref, prepend, flow-control
RT-1.29: BGP chained import/export policy attachment
RT-7.8: BGP Policy Match Standard Community and Add Community Import/Export Policy
RT-1.2: BGP Policy & Route Installation
RT-7.10: Routing policy statement insertion and removal
Cisco status
status
status
status
status
status
status
status
status
RT-1.27: Static route to BGP redistribution
RT-7.11: BGP Policy - Import/Export Policy Action Using Multiple Criteria
RT-1.30: BGP nested import/export policy attachment
gNMI-1.3: Benchmarking: Drained Configuration Convergence Time
RT-1.32: BGP policy actions - MED, LocPref, prepend, flow-control
RT-1.29: BGP chained import/export policy attachment
RT-7.8: BGP Policy Match Standard Community and Add Community Import/Export Policy
RT-1.2: BGP Policy & Route Installation
RT-7.10: Routing policy statement insertion and removal
Juniper status
status
status
status
status
status
status
status
status
RT-1.27: Static route to BGP redistribution
RT-7.11: BGP Policy - Import/Export Policy Action Using Multiple Criteria
RT-1.30: BGP nested import/export policy attachment
gNMI-1.3: Benchmarking: Drained Configuration Convergence Time
RT-1.32: BGP policy actions - MED, LocPref, prepend, flow-control
RT-1.29: BGP chained import/export policy attachment
RT-7.8: BGP Policy Match Standard Community and Add Community Import/Export Policy
RT-1.2: BGP Policy & Route Installation
RT-7.10: Routing policy statement insertion and removal
Nokia status
status
status
status
status
status
status
status
status
RT-1.27: Static route to BGP redistribution
RT-7.11: BGP Policy - Import/Export Policy Action Using Multiple Criteria
RT-1.30: BGP nested import/export policy attachment
gNMI-1.3: Benchmarking: Drained Configuration Convergence Time
RT-1.32: BGP policy actions - MED, LocPref, prepend, flow-control
RT-1.29: BGP chained import/export policy attachment
RT-7.8: BGP Policy Match Standard Community and Add Community Import/Export Policy
RT-1.2: BGP Policy & Route Installation
RT-7.10: Routing policy statement insertion and removal

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 updates several functional network tests (FNTs) to align with the latest BGP OpenConfig model revisions. The changes primarily focus on standardizing how import/export policies are managed, updating configuration paths for send-community and MED actions, and cleaning up redundant platform deviation assignments. Additionally, the PR introduces helper functions to improve test reliability and adds compatibility support for IS-IS authentication on specific platforms.

Highlights

  • BGP OpenConfig Model Update: Updated BGP peer-group and neighbor send-community paths and MED action configurations to align with the latest OpenConfig model.
  • Policy Management Refactoring: Standardized import/export policy replacement operations across multiple tests to improve reliability and consistency.
  • Deviation Cleanup: Removed several obsolete platform deviation assignments across multiple test suites.
  • Compatibility Fixes: Added IS-IS interface-level authentication support for specific platforms and improved BGP session readiness checks.
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.

@LiamWalsh98 LiamWalsh98 changed the title BGP OC uprev test changes in gNMI-1.3, RT-1.2, RT-1.27, RT-1.29, RT-1.30, RT-1.32, RT-7.8, RT-7.10, and RT-7.11 BGP OC uprev test changes in RT-1.2, RT-1.27, RT-1.29, RT-1.30, RT-1.32, RT-7.8, RT-7.10, RT-7.11, and gNMI-1.3 Sep 11, 2026

@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 refactors and cleans up several BGP policy and static route redistribution tests, primarily by standardizing policy application/deletion, handling various platform deviations (such as FlattenPolicyWithMultipleStatements and SetISISAuthWithInterfaceAuthenticationContainer), and improving OTG telemetry validation. The review feedback highlights a copy-paste bug in import_export_multi_test.go where default policies are set on the wrong policy object, and recommends defensive checks in awaitBGPReady to prevent nil pointer dereferences. Additionally, the reviewer advises replacing direct gnmi.Get calls with gnmi.Lookup in static_route_bgp_redistribution_test.go and drained_configuration_convergence_time_bgp_test.go to prevent fatal test failures when configurations are missing.

Comment on lines +755 to +760
for _, device := range bs.ATETop.Devices().Items() {
bgp4Peer := device.Bgp().Ipv4Interfaces().Items()[0].Peers().Items()[0]
bgp6Peer := device.Bgp().Ipv6Interfaces().Items()[0].Peers().Items()[0]
gnmi.Await(t, bs.ATE.OTG(), gnmi.OTG().BgpPeer(bgp4Peer.Name()).SessionState().State(), 2*time.Minute, otgtelemetry.BgpPeer_SessionState_ESTABLISHED)
gnmi.Await(t, bs.ATE.OTG(), gnmi.OTG().BgpPeer(bgp6Peer.Name()).SessionState().State(), 2*time.Minute, otgtelemetry.BgpPeer_SessionState_ESTABLISHED)
}

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

To enforce defensive programming and prevent potential runtime panics (e.g., index out of bounds or nil pointer dereferences), we should explicitly check if device.Bgp() is non-nil and ensure that both Ipv4Interfaces and Ipv6Interfaces contain items before accessing their elements.

Suggested change
for _, device := range bs.ATETop.Devices().Items() {
bgp4Peer := device.Bgp().Ipv4Interfaces().Items()[0].Peers().Items()[0]
bgp6Peer := device.Bgp().Ipv6Interfaces().Items()[0].Peers().Items()[0]
gnmi.Await(t, bs.ATE.OTG(), gnmi.OTG().BgpPeer(bgp4Peer.Name()).SessionState().State(), 2*time.Minute, otgtelemetry.BgpPeer_SessionState_ESTABLISHED)
gnmi.Await(t, bs.ATE.OTG(), gnmi.OTG().BgpPeer(bgp6Peer.Name()).SessionState().State(), 2*time.Minute, otgtelemetry.BgpPeer_SessionState_ESTABLISHED)
}
for _, device := range bs.ATETop.Devices().Items() {
if device.Bgp() == nil {
continue
}
if len(device.Bgp().Ipv4Interfaces().Items()) > 0 && len(device.Bgp().Ipv4Interfaces().Items()[0].Peers().Items()) > 0 {
bgp4Peer := device.Bgp().Ipv4Interfaces().Items()[0].Peers().Items()[0]
gnmi.Await(t, bs.ATE.OTG(), gnmi.OTG().BgpPeer(bgp4Peer.Name()).SessionState().State(), 2*time.Minute, otgtelemetry.BgpPeer_SessionState_ESTABLISHED)
}
if len(device.Bgp().Ipv6Interfaces().Items()) > 0 && len(device.Bgp().Ipv6Interfaces().Items()[0].Peers().Items()) > 0 {
bgp6Peer := device.Bgp().Ipv6Interfaces().Items()[0].Peers().Items()[0]
gnmi.Await(t, bs.ATE.OTG(), gnmi.OTG().BgpPeer(bgp6Peer.Name()).SessionState().State(), 2*time.Minute, otgtelemetry.BgpPeer_SessionState_ESTABLISHED)
}
}

Comment on lines +629 to +631
tableConn := gnmi.Get[*oc.NetworkInstance_TableConnection](t, dut, tableConnPath.Config())
tableConn.ImportPolicy = nil
gnmi.Replace(t, dut, tableConnPath.Config(), tableConn)

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 gnmi.Get directly on tableConnPath.Config() will cause the test to fail immediately if the TableConnection is not yet configured (for example, when running this subtest individually). To ensure test independence and robustness, use gnmi.Lookup to check if the table connection is present before attempting to modify it.

	tableConn, present := gnmi.Lookup(t, dut, tableConnPath.Config()).Val()
	if !present || tableConn == nil {
		return
	}
	tableConn.ImportPolicy = nil
	gnmi.Replace(t, dut, tableConnPath.Config(), tableConn)

Comment on lines +188 to +202
func replacePeerGroupExportPolicy(t *testing.T, dut *ondatra.DUTDevice, policy string) {
bgpPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).
Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp()
if deviations.RoutePolicyUnderAFIUnsupported(dut) {
policyPath := bgpPath.PeerGroup(setup.PeerGrpName).ApplyPolicy()
applyPolicy := gnmi.Get(t, dut, policyPath.Config())
applyPolicy.SetExportPolicy([]string{policy})
gnmi.Replace(t, dut, policyPath.Config(), applyPolicy)
return
}
policyPath := bgpPath.PeerGroup(setup.PeerGrpName).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy()
applyPolicy := gnmi.Get(t, dut, policyPath.Config())
applyPolicy.SetExportPolicy([]string{policy})
gnmi.Replace(t, dut, policyPath.Config(), applyPolicy)
}

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 gnmi.Get directly on policyPath.Config() assumes that the ApplyPolicy container is always present. If the subtests are run individually or if the configuration is not present, this will cause a fatal test failure. Using gnmi.Lookup with a fallback to a newly created object (similar to the pattern used in other tests) is much safer and more robust.

func replacePeerGroupExportPolicy(t *testing.T, dut *ondatra.DUTDevice, policy string) {
	bgpPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).
		Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp()
	if deviations.RoutePolicyUnderAFIUnsupported(dut) {
		policyPath := bgpPath.PeerGroup(setup.PeerGrpName).ApplyPolicy()
		applyPolicy, present := gnmi.Lookup(t, dut, policyPath.Config()).Val()
		if !present {
			applyPolicy = &oc.NetworkInstance_Protocol_Bgp_PeerGroup_ApplyPolicy{}
		}
		applyPolicy.SetExportPolicy([]string{policy})
		gnmi.Replace(t, dut, policyPath.Config(), applyPolicy)
		return
	}
	policyPath := bgpPath.PeerGroup(setup.PeerGrpName).AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).ApplyPolicy()
	applyPolicy, present := gnmi.Lookup(t, dut, policyPath.Config()).Val()
	if !present {
		applyPolicy = &oc.NetworkInstance_Protocol_Bgp_PeerGroup_AfiSafi_ApplyPolicy{}
	}
	applyPolicy.SetExportPolicy([]string{policy})
	gnmi.Replace(t, dut, policyPath.Config(), applyPolicy)
}

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants