Skip to content

TE-16.2 Fix#5098

Open
youssefyamoutyy wants to merge 2 commits intoopenconfig:mainfrom
b4firex:TE-16.2-fix-main
Open

TE-16.2 Fix#5098
youssefyamoutyy wants to merge 2 commits intoopenconfig:mainfrom
b4firex:TE-16.2-fix-main

Conversation

@youssefyamoutyy
Copy link
Contributor

Brief description and need for this PR
This PR enhances the ISIS interface configuration by properly populating the interface-ref with base interface and sub-interface index information. This ensures that ISIS interfaces are correctly configured with their interface references.

Proposed changes

Added proper interface-ref configuration for ISIS interfaces in configureISIS function.
Populated interface-ref with base interface and subinterface index when interface name contains a dot notation.
Added check for InterfaceRefConfigUnsupported deviation to handle devices that don't support interface-ref config.
Ensured ISIS interface configuration properly parses interface names and subinterface indices.

@youssefyamoutyy youssefyamoutyy requested a review from a team as a code owner February 18, 2026 02:27
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @youssefyamoutyy, 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 refines the ISIS interface configuration logic by accurately populating interface references. It introduces robust parsing for interface names, including those with sub-interface identifiers, and incorporates deviation handling to ensure compatibility across different device capabilities. The changes aim to improve the reliability and correctness of ISIS interface setups within the test framework.

Highlights

  • ISIS Interface-Ref Population: Enhanced the configureISIS function to properly populate the interface-ref field with base interface and sub-interface index information, ensuring correct ISIS interface configuration.
  • Sub-interface Handling: Implemented logic to parse interface names containing dot notation (e.g., ethernet-1.1) to correctly extract the base interface name and sub-interface index.
  • Deviation Handling: Added a check for the InterfaceRefConfigUnsupported deviation, allowing the interface-ref configuration to be omitted for devices that do not support it.
  • Interface Naming Consistency: Refined the handling of interface names for deviations requiring a .0 suffix, ensuring isisIntfName is correctly formed while preserving base interface and sub-interface parsing.
Changelog
  • feature/gribi/otg_tests/encap_frr/encap_frr_test.go
    • Imported the strconv package for string to integer conversion.
    • Modified the configureISIS function to parse interface names, extracting base interface and sub-interface index.
    • Updated the logic for applying .0 suffixes to interface names based on ExplicitInterfaceInDefaultVRF and InterfaceRefInterfaceIDFormat deviations.
    • Populated the interface-ref field with the extracted base interface and sub-interface index.
    • Added conditional logic to clear the InterfaceRef if the InterfaceRefConfigUnsupported deviation is present.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

@google-cla
Copy link

google-cla bot commented Feb 18, 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

Pull Request Functional Test Report for #5098 / c95f5c0

Virtual Devices

Device Test Test Documentation Job Raw Log
Arista cEOS status
TE-16.2: encapsulation FRR scenarios
Cisco 8000E status
TE-16.2: encapsulation FRR scenarios
Cisco XRd status
TE-16.2: encapsulation FRR scenarios
Juniper ncPTX status
TE-16.2: encapsulation FRR scenarios
Nokia SR Linux status
TE-16.2: encapsulation FRR scenarios
Openconfig Lemming status
TE-16.2: encapsulation FRR scenarios

Hardware Devices

Device Test Test Documentation Raw Log
Arista 7808 status
TE-16.2: encapsulation FRR scenarios
Cisco 8808 status
TE-16.2: encapsulation FRR scenarios
Juniper PTX10008 status
TE-16.2: encapsulation FRR scenarios
Nokia 7250 IXR-10e status
TE-16.2: encapsulation FRR scenarios

Help

Copy link
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 enhances ISIS interface configuration by adding support for interface-ref. The changes correctly parse interface names to populate the base interface and subinterface index. However, I've found a potential issue in the logic that handles deviations for interface naming, which could lead to incorrect ISIS interface names when a subinterface is already specified. I've provided a suggestion to simplify the logic and fix this bug. The rest of the changes for populating interface-ref and handling the InterfaceRefConfigUnsupported deviation look good.

Comment on lines +505 to 528
// Parse interface name to extract base interface and subinterface index
baseIntf := intfName
subIdx := uint32(0)
if strings.Contains(intfName, ".") {
parts := strings.SplitN(intfName, ".", 2)
baseIntf = parts[0]
if len(parts) == 2 {
if v, err := strconv.ParseUint(parts[1], 10, 32); err == nil {
subIdx = uint32(v)
}
}
}
if deviations.InterfaceRefInterfaceIDFormat(dut) {
intfName += ".0"

// For deviations that require .0 suffix, ensure it's added
isisIntfName := intfName
if deviations.ExplicitInterfaceInDefaultVRF(dut) || deviations.InterfaceRefInterfaceIDFormat(dut) {
if !strings.HasSuffix(intfName, ".0") {
isisIntfName = intfName + ".0"
if !strings.Contains(intfName, ".") {
baseIntf = intfName
subIdx = 0
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The logic for parsing the interface name and handling deviations can be simplified and has a potential bug. When intfName already contains a subinterface (e.g., eth1.1), the current logic for deviations incorrectly appends .0, resulting in an invalid interface name like eth1.1.0. The deviation should likely only apply to base interfaces that don't already have a subinterface specified.

I suggest refactoring this block to be more concise and to correctly handle this edge case. The proposed change first parses the interface and subinterface, then applies the deviation logic only when no subinterface is already present.

Suggested change
// Parse interface name to extract base interface and subinterface index
baseIntf := intfName
subIdx := uint32(0)
if strings.Contains(intfName, ".") {
parts := strings.SplitN(intfName, ".", 2)
baseIntf = parts[0]
if len(parts) == 2 {
if v, err := strconv.ParseUint(parts[1], 10, 32); err == nil {
subIdx = uint32(v)
}
}
}
if deviations.InterfaceRefInterfaceIDFormat(dut) {
intfName += ".0"
// For deviations that require .0 suffix, ensure it's added
isisIntfName := intfName
if deviations.ExplicitInterfaceInDefaultVRF(dut) || deviations.InterfaceRefInterfaceIDFormat(dut) {
if !strings.HasSuffix(intfName, ".0") {
isisIntfName = intfName + ".0"
if !strings.Contains(intfName, ".") {
baseIntf = intfName
subIdx = 0
}
}
}
// Parse interface name to extract base interface and subinterface index.
baseIntf := intfName
var subIdx uint32
if parts := strings.SplitN(intfName, ".", 2); len(parts) == 2 {
baseIntf = parts[0]
if v, err := strconv.ParseUint(parts[1], 10, 32); err == nil {
subIdx = uint32(v)
}
}
// For deviations that require .0 suffix for base interfaces, ensure it's added.
isisIntfName := intfName
if (deviations.ExplicitInterfaceInDefaultVRF(dut) || deviations.InterfaceRefInterfaceIDFormat(dut)) && !strings.Contains(intfName, ".") {
isisIntfName = intfName + ".0"
}

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