Skip to content

Commit

Permalink
[yang] added mclag sonic yang (#7622)
Browse files Browse the repository at this point in the history
#### How I did it
Added mclag sonic yang file for the MCLAG enhancements  as per HLD: sonic-net/SONiC#596

#### How to verify it
try rest APIs

#### Description for the changelog
Added mclag sonic yang
  • Loading branch information
gitsabari authored Jan 27, 2022
1 parent 2532d65 commit 018a649
Show file tree
Hide file tree
Showing 5 changed files with 613 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/sonic-yang-models/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ def run(self):
'./yang-models/sonic-versions.yang',
'./yang-models/sonic-vlan.yang',
'./yang-models/sonic-vrf.yang',

'./yang-models/sonic-mclag.yang',

'./yang-models/sonic-vlan-sub-interface.yang',

'./yang-models/sonic-warm-restart.yang',
'./yang-models/sonic-lldp.yang',
'./yang-models/sonic-scheduler.yang',
Expand Down
51 changes: 49 additions & 2 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@
"tpid": "0x9200",
"mtu": "9100",
"lacp_key": "auto"
},
"PortChannel2": {
"admin_status": "up",
"min_links": "1",
"members": [
"Ethernet12"
],
"tpid": "0x9200",
"mtu": "9100",
"lacp_key": "auto"
}
},
"PORTCHANNEL_INTERFACE": {
Expand All @@ -103,7 +113,8 @@
},
"PORTCHANNEL_MEMBER": {
"PortChannel0003|Ethernet1": {},
"PortChannel0004|Ethernet2": {}
"PortChannel0004|Ethernet2": {},
"PortChannel2|Ethernet12": {}
},
"VLAN_INTERFACE": {
"Vlan111": {
Expand Down Expand Up @@ -309,7 +320,17 @@
"vlanid": "777",
"mtu": "9216",
"admin_status": "up"
},
"Vlan12": {
"description": "mclag session ve",
"dhcp_servers": [
"12.1.1.1"
],
"vlanid": "12",
"mtu": "9216",
"admin_status": "up"
}

},
"DEVICE_NEIGHBOR": {
"Ethernet112": {
Expand Down Expand Up @@ -909,6 +930,9 @@
},
"Vlan111|PortChannel0003": {
"tagging_mode": "untagged"
},
"Vlan12|PortChannel2": {
"tagging_mode": "tagged"
}
},
"LOOPBACK_INTERFACE": {
Expand Down Expand Up @@ -1197,6 +1221,7 @@
"trap_group": "queue1_group1"
}
},

"AUTO_TECHSUPPORT": {
"GLOBAL": {
"state" : "enabled",
Expand Down Expand Up @@ -1331,7 +1356,6 @@
"type": "DWRR",
"weight": "20"
},

"TEST@1": {
"cbs": "1024",
"cir": "1280000",
Expand Down Expand Up @@ -1480,6 +1504,28 @@
}
},


"MCLAG_DOMAIN": {
"123": {
"source_ip": "12.1.1.1",
"peer_ip": "12.1.1.2",
"peer_link": "PortChannel2",
"keepalive_interval": "1",
"session_timeout": "30"
}
},
"MCLAG_INTERFACE": {
"123|PortChannel0004": {
"if_type": "PortChannel"
}
},
"MCLAG_UNIQUE_IP": {
"Vlan12": {
"unique_ip": "enable"
}
},


"MIRROR_SESSION": {
"erspan": {
"dscp": "10",
Expand All @@ -1498,6 +1544,7 @@
"Ethernet3",
"Ethernet4"
]

}
}
},
Expand Down
32 changes: 32 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/mclag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"MCLAG_VALID_DOMAIN_CFG_TEST": {
"desc": "valid mclag configuration test"
},
"MCLAG_VALID_DOMAIN_PEERLINK_ETH_TEST": {
"desc": "valid mclag configuration test with peer link ethernet"
},
"MCLAG_INVALID_DOMAIN_IDS_TEST": {
"desc": "configure mclag domain id in range",
"eStr": "MCLAG Domain ID out of range"
},
"MCLAG_INVALID_KEEPALIVE_TEST": {
"desc": "configure mclag keepalive values in range",
"eStr" : "MCLAG Domain keepalive interval out of range"
},
"MCLAG_INVALID_SESSION_TIMEOUT_TEST": {
"desc": "configure mclag session timeout in range",
"eStr" : "MCLAG Domain session timeout out of range"
},
"MCLAG_INVALID_KEEPALIVE_MUST_COND_TEST": {
"desc": "Invalid session and keepalive multiplier",
"eStr" : "(keepalive interval * 3) <= session_timeout value"
},
"MCLAG_INTERFACE_DOMAIN_ABSENT_TEST": {
"desc": "mclag interface configured without domain",
"eStrKey" : "LeafRef"
},
"MCLAG_UNIQUE_IP_DOMAIN_ABSENT_TEST": {
"desc": "mclag unique ip configured without domain",
"eStr" : "mclag not configured"
}
}
Loading

0 comments on commit 018a649

Please sign in to comment.