Skip to content

[gNOI-4.1] Fix verification of intf and BGP status after config push#5385

Open
sriram-arista wants to merge 1 commit intoopenconfig:mainfrom
sriram-arista:gNOI-4.1-fix
Open

[gNOI-4.1] Fix verification of intf and BGP status after config push#5385
sriram-arista wants to merge 1 commit intoopenconfig:mainfrom
sriram-arista:gNOI-4.1-fix

Conversation

@sriram-arista
Copy link
Copy Markdown

@sriram-arista sriram-arista commented Apr 27, 2026

Issue: TestPushAndVerifyInterfaceConfig and TestPushAndVerifyBGPConfig push config via gNMI and then verify the response if it matches with the pushed config. But the received config could contain additional leaf nodes due to the operational / default state.

Fix:
Verify only the leaf nodes which are explicitly configured in the test.

  • neighbor.enabled leaf node has a YANG default of True and is not returned in the response so used missing_value_for_defaults deviation.
  • Added a deviation bgp_default_vrf_ipv4_unicast_afi_safi_enabled_leaf_missing to get the implicit state when the leaf node (bgp/global/afi-safis[IPV4_Unicast]/state/enabled - for which the YANG default is deleted in Arista implementation) is missing

@sriram-arista sriram-arista requested a review from a team as a code owner April 27, 2026 08:46
@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 27, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@OpenConfigBot
Copy link
Copy Markdown

OpenConfigBot commented Apr 27, 2026

Pull Request Functional Test Report for #5385 / fa3e734

Virtual Devices

Device Test Test Documentation Job Raw Log
Arista cEOS status
gNOI-4.1: Software Upgrade
Cisco 8000E status
gNOI-4.1: Software Upgrade
Cisco XRd status
gNOI-4.1: Software Upgrade
Juniper ncPTX status
gNOI-4.1: Software Upgrade
Nokia SR Linux status
gNOI-4.1: Software Upgrade
Openconfig Lemming status
gNOI-4.1: Software Upgrade

Hardware Devices

Device Test Test Documentation Raw Log
Arista 7808 status
gNOI-4.1: Software Upgrade
Cisco 8808 status
gNOI-4.1: Software Upgrade
Juniper PTX10008 status
gNOI-4.1: Software Upgrade
Nokia 7250 IXR-10e status
gNOI-4.1: Software Upgrade

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 improves the robustness of configuration verification tests by shifting from full object comparison to explicit leaf node validation. This change prevents test failures caused by the presence of additional operational or default state nodes in the device response. Necessary infrastructure for handling these implicit defaults has been added via new metadata deviations.

Highlights

  • Configuration Verification: Updated test cases to verify only explicitly configured leaf nodes, avoiding failures due to implicit or default operational state.
  • New Deviations: Introduced 'missing_value_for_defaults' and 'bgp_default_vrf_ipv4_unicast_afi_safi_enabled_leaf_missing' to handle expected missing default values in device responses.
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 refactors the interface and BGP configuration verification in osinstall_test.go to use granular GNMI lookups instead of deep equality checks and introduces a new deviation for missing BGP enabled leaves. The review feedback identifies that using gnmi.Get for leaves that may be omitted by the device can cause fatal test failures, recommending gnmi.LookupConfig instead. Additionally, the feedback suggests that the newly added specific BGP deviation is redundant and should be replaced by the existing MissingValueForDefaults deviation to maintain consistency and reduce code duplication.

Comment thread feature/gnoi/os/tests/osinstall/osinstall_test.go
Comment thread feature/gnoi/os/tests/osinstall/osinstall_test.go
Comment thread feature/gnoi/os/tests/osinstall/osinstall_test.go
Comment thread internal/deviations/deviations.go
Comment thread proto/metadata.proto Outdated
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