Skip to content

Commit ab1bdef

Browse files
gitsabaripull[bot]
authored andcommitted
[yang] added mclag sonic yang (#7622)
#### 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
1 parent 7ef422c commit ab1bdef

File tree

5 files changed

+613
-2
lines changed

5 files changed

+613
-2
lines changed

src/sonic-yang-models/setup.py

+4
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ def run(self):
122122
'./yang-models/sonic-versions.yang',
123123
'./yang-models/sonic-vlan.yang',
124124
'./yang-models/sonic-vrf.yang',
125+
126+
'./yang-models/sonic-mclag.yang',
127+
125128
'./yang-models/sonic-vlan-sub-interface.yang',
129+
126130
'./yang-models/sonic-warm-restart.yang',
127131
'./yang-models/sonic-lldp.yang',
128132
'./yang-models/sonic-scheduler.yang',

src/sonic-yang-models/tests/files/sample_config_db.json

+49-2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@
9393
"tpid": "0x9200",
9494
"mtu": "9100",
9595
"lacp_key": "auto"
96+
},
97+
"PortChannel2": {
98+
"admin_status": "up",
99+
"min_links": "1",
100+
"members": [
101+
"Ethernet12"
102+
],
103+
"tpid": "0x9200",
104+
"mtu": "9100",
105+
"lacp_key": "auto"
96106
}
97107
},
98108
"PORTCHANNEL_INTERFACE": {
@@ -103,7 +113,8 @@
103113
},
104114
"PORTCHANNEL_MEMBER": {
105115
"PortChannel0003|Ethernet1": {},
106-
"PortChannel0004|Ethernet2": {}
116+
"PortChannel0004|Ethernet2": {},
117+
"PortChannel2|Ethernet12": {}
107118
},
108119
"VLAN_INTERFACE": {
109120
"Vlan111": {
@@ -309,7 +320,17 @@
309320
"vlanid": "777",
310321
"mtu": "9216",
311322
"admin_status": "up"
323+
},
324+
"Vlan12": {
325+
"description": "mclag session ve",
326+
"dhcp_servers": [
327+
"12.1.1.1"
328+
],
329+
"vlanid": "12",
330+
"mtu": "9216",
331+
"admin_status": "up"
312332
}
333+
313334
},
314335
"DEVICE_NEIGHBOR": {
315336
"Ethernet112": {
@@ -909,6 +930,9 @@
909930
},
910931
"Vlan111|PortChannel0003": {
911932
"tagging_mode": "untagged"
933+
},
934+
"Vlan12|PortChannel2": {
935+
"tagging_mode": "tagged"
912936
}
913937
},
914938
"LOOPBACK_INTERFACE": {
@@ -1197,6 +1221,7 @@
11971221
"trap_group": "queue1_group1"
11981222
}
11991223
},
1224+
12001225
"AUTO_TECHSUPPORT": {
12011226
"GLOBAL": {
12021227
"state" : "enabled",
@@ -1331,7 +1356,6 @@
13311356
"type": "DWRR",
13321357
"weight": "20"
13331358
},
1334-
13351359
"TEST@1": {
13361360
"cbs": "1024",
13371361
"cir": "1280000",
@@ -1480,6 +1504,28 @@
14801504
}
14811505
},
14821506

1507+
1508+
"MCLAG_DOMAIN": {
1509+
"123": {
1510+
"source_ip": "12.1.1.1",
1511+
"peer_ip": "12.1.1.2",
1512+
"peer_link": "PortChannel2",
1513+
"keepalive_interval": "1",
1514+
"session_timeout": "30"
1515+
}
1516+
},
1517+
"MCLAG_INTERFACE": {
1518+
"123|PortChannel0004": {
1519+
"if_type": "PortChannel"
1520+
}
1521+
},
1522+
"MCLAG_UNIQUE_IP": {
1523+
"Vlan12": {
1524+
"unique_ip": "enable"
1525+
}
1526+
},
1527+
1528+
14831529
"MIRROR_SESSION": {
14841530
"erspan": {
14851531
"dscp": "10",
@@ -1498,6 +1544,7 @@
14981544
"Ethernet3",
14991545
"Ethernet4"
15001546
]
1547+
15011548
}
15021549
}
15031550
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"MCLAG_VALID_DOMAIN_CFG_TEST": {
3+
"desc": "valid mclag configuration test"
4+
},
5+
"MCLAG_VALID_DOMAIN_PEERLINK_ETH_TEST": {
6+
"desc": "valid mclag configuration test with peer link ethernet"
7+
},
8+
"MCLAG_INVALID_DOMAIN_IDS_TEST": {
9+
"desc": "configure mclag domain id in range",
10+
"eStr": "MCLAG Domain ID out of range"
11+
},
12+
"MCLAG_INVALID_KEEPALIVE_TEST": {
13+
"desc": "configure mclag keepalive values in range",
14+
"eStr" : "MCLAG Domain keepalive interval out of range"
15+
},
16+
"MCLAG_INVALID_SESSION_TIMEOUT_TEST": {
17+
"desc": "configure mclag session timeout in range",
18+
"eStr" : "MCLAG Domain session timeout out of range"
19+
},
20+
"MCLAG_INVALID_KEEPALIVE_MUST_COND_TEST": {
21+
"desc": "Invalid session and keepalive multiplier",
22+
"eStr" : "(keepalive interval * 3) <= session_timeout value"
23+
},
24+
"MCLAG_INTERFACE_DOMAIN_ABSENT_TEST": {
25+
"desc": "mclag interface configured without domain",
26+
"eStrKey" : "LeafRef"
27+
},
28+
"MCLAG_UNIQUE_IP_DOMAIN_ABSENT_TEST": {
29+
"desc": "mclag unique ip configured without domain",
30+
"eStr" : "mclag not configured"
31+
}
32+
}

0 commit comments

Comments
 (0)