Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a68a9ab
[Yang Models] Add Young Model and tests for VNET_ROUTE_TUNNEL table
miatttao Feb 20, 2025
5e394d9
Fix error messages
miatttao Feb 21, 2025
8367814
Fix eStr
miatttao Feb 21, 2025
a650a9b
Enforce uniqueness on vxlanid
miatttao Feb 25, 2025
163f363
Fix name format
miatttao Feb 25, 2025
9edb03d
Add unique for vxlanid
miatttao Feb 25, 2025
bc04f3f
Fix error messages match issue
miatttao Feb 25, 2025
6db2d16
Fix error messages match issue after experiment
miatttao Feb 25, 2025
06b9d19
Fix error messages match issue after experiment
miatttao Feb 25, 2025
065726e
Fix
miatttao Feb 25, 2025
ba92d31
Fix sample data
miatttao Feb 25, 2025
fec860e
(1) Insert VNET_ROUTE_TUNNEL table in sonic-vnet.yang file and fix te…
miatttao Mar 5, 2025
f7e11e2
Fix for sample data
miatttao Mar 5, 2025
770841c
Fix merge issue
miatttao Mar 5, 2025
cebfe3c
fix for test in sample.config
miatttao Mar 6, 2025
c9f8488
Fix
miatttao Mar 6, 2025
c1535ee
Fix test_SonicYang::test_xlate_rev_xlate mismatch
miatttao Mar 6, 2025
a0be257
Merge branch 'sonic-net:master' into mia-add-yang-new
miatttao Mar 7, 2025
0ea4746
Use predefined ip-prefix type
miatttao Mar 7, 2025
1c517ba
Merge branch 'sonic-net:master' into mia-add-yang-new
miatttao Mar 8, 2025
048cc46
Change vxlanid to vni based on sonic-swss vnetorch.cpp
miatttao Mar 10, 2025
0e0f21f
Merge branch 'mia-add-yang-new' of https://github.com/miatttao/sonic-…
miatttao Mar 10, 2025
09c7835
Merge branch 'sonic-net:master' into mia-add-yang-new
miatttao Mar 10, 2025
5de0aaa
Merge branch 'sonic-net:master' into mia-add-yang-new
miatttao Mar 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
* [VLAN](#vlan)
* [VLAN_MEMBER](#vlan_member)
* [VNET](#vnet)
* [VNET_ROUTE_TUNNEL](#vnet_route_tunnel)
* [VOQ Inband Interface](#voq-inband-interface)
* [VXLAN](#vxlan)
* [Virtual router](#virtual-router)
Expand Down Expand Up @@ -2567,6 +2568,29 @@ monitoring sessions for the vnet routes and is optional.
}
```

### VNET_ROUTE_TUNNEL

VNET_ROUTE_TUNNEL table has vnet_name|prefix as the object key, where vnet_name is the name of the VNet and prefix is the ip4 prefix associated with the route tunnel. The table includes the following attributes:
- ENDPOINT: The endpoint/nexthop tunnel IP (mandatory). It is used to identify the endpoint of the tunnel.
- MAC_ADDRESS: The inner destination MAC address in the encapsulated packet (optional). It should be a 12-hexadeimal digit value.
- VNI: The VNI value in the encapsulated packet (optional). It should be a numeric value.

```
{
"VNET_ROUTE_TUNNEL": {
"Vnet_2000|100.100.1.1/32": {
"endpoint": "192.168.1.1",
"mac_address": "f9:22:83:99:22:a2"
},
"Vnetv4_v4-0|10.0.1.0/24": {
"endpoint": "192.168.1.2",
"mac_address": "f8:22:83:99:22:a2",
"vni": "10012"
}
}
}
```

### VOQ INBAND INTERFACE

VOQ_INBAND_INTERFACE holds the name of the inband system port dedicated for cpu communication. At this time, only inband_type of "port" is supported
Expand Down
7 changes: 7 additions & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -2340,6 +2340,13 @@
"overlay_dmac": "22:33:44:55:66:77"
}
},
"VNET_ROUTE_TUNNEL" : {
"vnet1|10.0.0.0/24" : {
"endpoint": "192.168.1.2",
"mac_address": "f9:22:83:99:22:a2",
"vni": "10011"
}
},
"PORT_QOS_MAP": {
"Ethernet0": {
"dot1p_to_tc_map" : "Dot1p_to_tc_map1",
Expand Down
51 changes: 51 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/vnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,56 @@
"VNET_INVALID_VXLAN_VTEP": {
"desc": "Missing Vxlan_TUNNEL configuration",
"eStr" : [ "points to a non-existing leaf" ]
},
"VNET_ROUTE_TUNNEL_MIN_TEST": {
"desc": "Basic VNET route tunnel configuration with minimal required field - endpoint in VNET_ROUTE_TUNNEL_LIST table."
},

"VNET_ROUTE_TUNNEL_MULTI_TEST": {
"desc": "Multiple VNET route tunnel configurations for different VNETs in VNET_ROUTE_TUNNEL_LIST table."
},

"VNET_ROUTE_TUNNEL_COMPLETE_TEST": {
"desc": "Complete VNET route tunnel configuration with all optional fields (including mac_address and vni) in VNET_ROUTE_TUNNEL_LIST table."
},

"VNET_ROUTE_TUNNEL_TEST_DUPLICATE_NAME": {
"desc": "VNET route tunnel configuration with duplicate name keys in VNET_ROUTE_TUNNEL_LIST table.",
"eStr": "Duplicated instance of \"VNET_ROUTE_TUNNEL_LIST\" list."
},

"VNET_ROUTE_TUNNEL_TEST_INVALID_ENDPOINT": {
"desc": "VNET route tunnel configuration with invalid endpoint IP value (256.256.256.256) in VNET_ROUTE_TUNNEL_LIST table.",
"eStr": "Value \"256.256.256.256\" does not satisfy the constraint"
},

"VNET_ROUTE_TUNNEL_TEST_INVALID_MAC": {
"desc": "VNET route tunnel configuration with invalid MAC address format (non-hexadecimal characters) in VNET_ROUTE_TUNNEL_LIST table.",
"eStr": "Value \"GG:HH:II:JJ:KK:LL\" does not satisfy the constraint \"[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}\""
},

"VNET_ROUTE_TUNNEL_TEST_INVALID_VNI": {
"desc": "VNET route tunnel configuration with invalid VXLAN ID (exceeding max value of 16777215) in VNET_ROUTE_TUNNEL_LIST table.",
"eStr": "Value \"16777216\" does not satisfy the constraint \"1..16777215\""
},

"VNET_ROUTE_TUNNEL_TEST_INVALID_NAME_FORMAT": {
"desc": "VNET route tunnel configuration with invalid name format (missing prefix) in VNET_ROUTE_TUNNEL_LIST table.",
"eStr": "Missing required element \"prefix\" in \"VNET_ROUTE_TUNNEL_LIST\""
},

"VNET_ROUTE_TUNNEL_TEST_INVALID_PREFIX": {
"desc": "VNET route tunnel configuration with invalid prefix format (300.168.1.0/24) in name field.",
"eStr": "Value \"300.168.1.0/24\" does not satisfy the constraint \"((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2])))\" (range, length, or pattern)\""
},

"VNET_ROUTE_TUNNEL_TEST_MISSING_ENDPOINT": {
"desc": "VNET route tunnel configuration with missing mandatory attribute (endpoint) in VNET_ROUTE_TUNNEL_LIST table.",
"eStr": "Missing required element \"endpoint\" in \"VNET_ROUTE_TUNNEL_LIST\"."
},

"VNET_ROUTE_TUNNEL_TEST_NONEXISTENT_VNET": {
"desc": "VNET route tunnel configuration referencing a non-existent VNET name, violating the must condition.",
"eStr": "Leafref \"/sonic-vnet:sonic-vnet/sonic-vnet:VNET/sonic-vnet:VNET_LIST/sonic-vnet:name\" of value \"NonexistentVnet\" points to a non-existing leaf"
}
}
Loading
Loading