Skip to content

[Yang] Add Yang Model and tests for VNET_ROUTE table#25312

Merged
qiluo-msft merged 10 commits intosonic-net:masterfrom
alawing:dev/davizhang/vnetroute
Mar 31, 2026
Merged

[Yang] Add Yang Model and tests for VNET_ROUTE table#25312
qiluo-msft merged 10 commits intosonic-net:masterfrom
alawing:dev/davizhang/vnetroute

Conversation

@alawing
Copy link
Copy Markdown
Contributor

@alawing alawing commented Feb 2, 2026

Why I did it

Added YANG model and tests for VNET_ROUTE table to provide schema validation and testing capabilities for VNET route configurations.

Work item tracking

How I did it

  • Edit the existing sonic-vnet.yang model to define the VNET_ROUTE table schema

  • Added comprehensive test cases covering both valid and invalid configurations

  • Implemented validation for:

    • Mandatory nexthop field

    • Mandatory Interface name field

How to verify it

Review the YANG model against the config_db schema

Test validated
image

Which release branch to backport (provide reason below if selected)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202506
  • 202511

Tested branch (Please provide the tested image version)

  • 202511

Description for the changelog

Link to config_db schema for YANG module changes

https://github.com/prsunny/SONiC/blob/gh-pages/doc/vxlan/Vxlan_hld.md#21-config-db

…idation and testing capabilities for VNET route configurations.

Signed-off-by: alawing <alawing@gmail.com>
@alawing alawing requested a review from qiluo-msft as a code owner February 2, 2026 22:16
Copilot AI review requested due to automatic review settings February 2, 2026 22:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds YANG model support and comprehensive testing for the VNET_ROUTE table to provide schema validation for VNET route configurations in SONiC.

Changes:

  • Added VNET_ROUTE container definition to sonic-vnet.yang with mandatory nexthop and ifname fields
  • Created 9 test cases covering valid configurations, invalid inputs, and edge cases
  • Updated configuration documentation to describe the VNET_ROUTE table structure and usage

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/sonic-yang-models/yang-models/sonic-vnet.yang Defines the VNET_ROUTE table schema with vnet_name and prefix as keys, nexthop and ifname as mandatory fields
src/sonic-yang-models/tests/yang_model_tests/tests_config/vnet.json Adds test data for valid and invalid VNET_ROUTE configurations
src/sonic-yang-models/tests/yang_model_tests/tests/vnet.json Adds test case definitions with expected validation behavior
src/sonic-yang-models/tests/files/sample_config_db.json Adds sample VNET_ROUTE configuration entry
src/sonic-yang-models/doc/Configuration.md Documents the VNET_ROUTE table structure and attributes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/sonic-yang-models/yang-models/sonic-vnet.yang
Comment thread src/sonic-yang-models/doc/Configuration.md Outdated
@alawing alawing closed this Feb 3, 2026
@alawing alawing reopened this Feb 3, 2026
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI review requested due to automatic review settings February 3, 2026 17:45
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/sonic-yang-models/yang-models/sonic-vnet.yang Outdated
Comment thread src/sonic-yang-models/yang-models/sonic-vnet.yang
Signed-off-by: alawing <alawing@gmail.com>
Signed-off-by: alawing <alawing@gmail.com>
Signed-off-by: alawing <alawing@gmail.com>
Signed-off-by: alawing <alawing@gmail.com>
Signed-off-by: alawing <alawing@gmail.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Comment thread src/sonic-yang-models/yang-templates/sonic-types.yang.j2 Outdated
Signed-off-by: alawing <alawing@gmail.com>
Copilot AI review requested due to automatic review settings March 4, 2026 01:12
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/sonic-yang-models/yang-models/sonic-vnet.yang
@prsunny
Copy link
Copy Markdown
Contributor

prsunny commented Mar 27, 2026

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to msft-202506: Azure/sonic-buildimage-msft#2130

@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202511: #26593

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.

10 participants