Skip to content

feat: Add legacy pattern support for EVPN ethernet segments (17.12 compatibility) #356

@aitestino

Description

@aitestino

Problem

PR #355 addressed the EVPN ethernet-segment-num test failures by excluding tests on platforms/versions that don't support it. However, the implementation doesn't follow the provider's established pattern for version compatibility.

The YANG path for EVPN ethernet segments differs between IOS-XE versions:

  • 17.12: Cisco-IOS-XE-l2vpn:evpn/ethernet-segment
  • 17.15+: Cisco-IOS-XE-l2vpn:evpn/ethernet-segment-choice/evpn-num-case/ethernet-segment-num/ethernet-segment

Current Implementation

The current interface_port_channel.yaml only supports the 17.15+ path:

- yang_name: Cisco-IOS-XE-l2vpn:evpn/ethernet-segment-choice/evpn-num-case/ethernet-segment-num/ethernet-segment
  xpath: Cisco-IOS-XE-l2vpn:evpn/ethernet-segment-num/ethernet-segment
  tf_name: evpn_ethernet_segments

Proposed Solution

Follow the provider's established "legacy" pattern used in other resources (e.g., route_map.yaml):

  1. Keep the current attribute for 17.15+
  2. Add a new _legacy suffixed attribute for 17.12
  3. Use test_tags to control which versions use which attribute

Example Implementation

Current attribute for 17.15+

  - yang_name: Cisco-IOS-XE-l2vpn:evpn/ethernet-segment-choice/evpn-num-case/ethernet-segment-num/ethernet-segment
    xpath: Cisco-IOS-XE-l2vpn:evpn/ethernet-segment-num/ethernet-segment
    tf_name: evpn_ethernet_segments
    test_tags: [IOSXE1715]
    type: List
    attributes:
      - yang_name: es-value
        id: true
        example: 1

  # New legacy attribute for 17.12
  - yang_name: Cisco-IOS-XE-l2vpn:evpn/ethernet-segment
    xpath: Cisco-IOS-XE-l2vpn:evpn/ethernet-segment
    tf_name: evpn_ethernet_segments_legacy
    test_tags: [IOSXE1712]
    type: List
    attributes:
      - yang_name: es-value
        id: true
        example: 1

Tasks

Acceptance Criteria

  • EVPN ethernet segment configuration works on 17.15+ using the standard attribute
  • EVPN ethernet segment configuration works on 17.12 using the legacy attribute
  • Tests pass on all pipeline environments
  • No breaking changes to existing configurations

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions