[Yang] Add Yang Model and tests for VNET_ROUTE table#25312
[Yang] Add Yang Model and tests for VNET_ROUTE table#25312qiluo-msft merged 10 commits intosonic-net:masterfrom
Conversation
…idation and testing capabilities for VNET route configurations. Signed-off-by: alawing <alawing@gmail.com>
There was a problem hiding this comment.
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.
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
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.
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>
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: alawing <alawing@gmail.com>
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
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.
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Cherry-pick PR to msft-202506: Azure/sonic-buildimage-msft#2130 |
|
Cherry-pick PR to 202511: #26593 |
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

Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
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