Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YANG MODEL] SONiC Yang support for VXLAN #7294

Merged
merged 15 commits into from
Jul 8, 2022
1 change: 1 addition & 0 deletions src/sonic-yang-models/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def run(self):
'./yang-models/sonic-types.yang',
'./yang-models/sonic-versions.yang',
'./yang-models/sonic-vlan.yang',
'./yang-models/sonic-vxlan.yang',
'./yang-models/sonic-vrf.yang',
'./yang-models/sonic-warm-restart.yang',
'./yang-models/sonic-lldp.yang',
Expand Down
11 changes: 10 additions & 1 deletion src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,16 @@
"4": "4"
}
},

"VXLAN_TUNNEL|vtep1": {
"src_ip": "1.1.1.1"
},
"VXLAN_EVPN_NVO|nvo1": {
"source_vtep": "vtep1"
},
"VXLAN_TUNNEL_MAP|vtep1|map_100_Vlan100": {
"vni" : "100",
"vlan": "Vlan100"
},
"PORT_QOS_MAP": {
"Ethernet0": {
"dot1p_to_tc_map" : "Dot1p_to_tc_map1",
Expand Down
25 changes: 25 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/vxlan.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"VXLAN_VALID_TEST": {
"desc": "Valid VXLAN Configuration."
},
"VXLAN_VTEP_WRONG_NAME": {
"desc": "INCORRECT NAME in VXLAN_TUNNEL TABLE",
"eStr": ["Error: Name should start with vtep"]
},
"VXLAN_EVPN_NVO_WITHOUT_VTEP": {
"desc": "Configure EVPN_NVO without VXLAN_TUNNEL entry",
"eStrKey" : "LeafRef"
},
"VXLAN_MAP_WITHOUT_VTEP": {
"desc": "Configure VXLAN_TUNNEL_MAP without VXLAN_TUNNEL entry",
"eStrKey" : "LeafRef"
},
"VXLAN_MAP_WITHOUT_VLAN": {
"desc": "Configure VXLAN_TUNNEL_MAP without VLAN entry",
"eStrKey" : "LeafRef"
},
"VXLAN_MAP_OOR_VNI": {
"desc": "VNI Out of Range in VXLAN_TUNNEL_MAP TABLE",
"eStr": ["Error: VNI ID out of range"]
}
}
149 changes: 149 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests_config/vxlan.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
{
"VXLAN_VALID_TEST": {
"sonic-vlan:sonic-vlan": {
"sonic-vlan:VLAN": {
"VLAN_LIST": [
{
"name": "Vlan100"
}
]
}
},
"sonic-vxlan:sonic-vxlan": {
"sonic-vxlan:VXLAN_TUNNEL": {
"VXLAN_TUNNEL_LIST": [
{
"name": "vtep1",
"src_ip": "1.2.3.4"
}
]
}
},
"sonic-vxlan:sonic-vxlan": {
"sonic-vxlan:VXLAN_EVPN_NVO": {
"VXLAN_EVPN_NVO_LIST": [
{
"name": "nvo1",
"source_vtep": "vtep1"
}
]
}
},
"sonic-vxlan:sonic-vxlan": {
"sonic-vxlan:VXLAN_TUNNEL_MAP": {
"VXLAN_TUNNEL_MAP_LIST": [
{
"name": "vtep1",
"mapname": "map_100_Vlan100",
"vlan": "Vlan100",
"vni": "100"
}
]
}
}
},
"VXLAN_VTEP_WRONG_NAME": {
srj102 marked this conversation as resolved.
Show resolved Hide resolved
"sonic-vxlan:sonic-vxlan": {
"sonic-vxlan:VXLAN_TUNNEL": {
"VXLAN_TUNNEL_LIST": [
{
"name": "tunnel1",
"src_ip": "1.2.3.4"
}
]
}
}
},
"VXLAN_EVPN_NVO_WITHOUT_VTEP": {
"sonic-vxlan:sonic-vxlan": {
"sonic-vxlan:VXLAN_EVPN_NVO": {
"VXLAN_EVPN_NVO_LIST": [
{
"name": "nvo1",
"source_vtep": "vtep1"
}
]
}
}
},
"VXLAN_MAP_WITHOUT_VTEP": {
"sonic-vlan:sonic-vlan": {
"sonic-vlan:VLAN": {
"VLAN_LIST": [
{
"name": "Vlan100"
}
]
}
},
"sonic-vxlan:sonic-vxlan": {
"sonic-vxlan:VXLAN_TUNNEL_MAP": {
"VXLAN_TUNNEL_MAP_LIST": [
{
"name": "vtep1",
"mapname": "map_100_Vlan100",
"vlan": "Vlan100",
"vni": "100"
}
]
}
}
},
"VXLAN_MAP_WITHOUT_VLAN": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see corresponding key in tests/vxlan.json. Can you please check and update?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was removed in the last commit as the reference to vlan (import vlan) was failing the builds.
The intent is that this be re-added later once the import vlan is fixed. Hence it is being removed only in the
tests and not the tests_config.

"sonic-vxlan:sonic-vxlan": {
"sonic-vxlan:VXLAN_TUNNEL": {
"VXLAN_TUNNEL_LIST": [
{
"name": "vtep1",
"src_ip": "1.2.3.4"
}
]
}
},
"sonic-vxlan:sonic-vxlan": {
"sonic-vxlan:VXLAN_TUNNEL_MAP": {
"VXLAN_TUNNEL_MAP_LIST": [
{
"name": "vtep1",
"mapname": "map_100_Vlan100",
"vlan": "Vlan100",
"vni": "100"
}
]
}
}
},
"VXLAN_MAP_OOR_VNI": {
"sonic-vlan:sonic-vlan": {
"sonic-vlan:VLAN": {
"VLAN_LIST": [
{
"name": "Vlan100"
}
]
}
},
"sonic-vxlan:sonic-vxlan": {
"sonic-vxlan:VXLAN_TUNNEL": {
"VXLAN_TUNNEL_LIST": [
{
"name": "vtep1",
"src_ip": "1.2.3.4"
}
]
}
},
"sonic-vxlan:sonic-vxlan": {
"sonic-vxlan:VXLAN_TUNNEL_MAP": {
"VXLAN_TUNNEL_MAP_LIST": [
{
"name": "vtep1",
"mapname": "map_100_Vlan100",
"vlan": "Vlan100",
"vni": "16777299"
}
]
}
}
}
}
Loading