Skip to content

Commit ec451fd

Browse files
authored
Merge pull request #934 from mssonicbld/sonicbld/202412-merge
```<br>* 540b703 - (HEAD -> 202412) Merge branch '202411' of https://github.com/sonic-net/sonic-buildimage into 202412 (2025-03-21) [Sonic Automation] * 1a00c73 - (head/202411) [YANG] sonic-neigh.yang need support portchannel (#22095) (2025-03-21) [mssonicbld]<br>```
2 parents 59f9a63 + 540b703 commit ec451fd

File tree

3 files changed

+89
-16
lines changed

3 files changed

+89
-16
lines changed

src/sonic-yang-models/tests/yang_model_tests/tests/neigh.json

+12-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@
1010

1111
"NEIGH_INVALID_VLAN": {
1212
"desc": "Load NEIGH missing VLAN",
13-
"eStr": ["does not satisfy the constraint"]
13+
"eStrKey": "InvalidValue",
14+
"eStr": ["port"]
15+
},
16+
17+
"VALID_NEIGH_PORTCHANNEL": {
18+
"desc": "Load valid PORTCHANNEL"
19+
},
20+
21+
"NEIGH_INVALID_PORTCHANNEL": {
22+
"desc": "Load NEIGH missing PORTCHANNEL",
23+
"eStrKey": "InvalidValue",
24+
"eStr": ["port"]
1425
}
1526
}

src/sonic-yang-models/tests/yang_model_tests/tests_config/neigh.json

+60-5
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
"sonic-neigh:NEIGH": {
1414
"NEIGH_LIST": [
1515
{
16-
"vlan": "Vlan1000",
16+
"port": "Vlan1000",
1717
"neighbor": "100.1.1.3",
1818
"neigh": "00:02:02:03:04:05",
1919
"family": "IPv4"
2020
},
2121
{
22-
"vlan": "Vlan1000",
22+
"port": "Vlan1000",
2323
"neighbor": "100.1.1.4",
2424
"family": "IPv4"
2525
}
@@ -42,7 +42,7 @@
4242
"sonic-neigh:NEIGH": {
4343
"NEIGH_LIST": [
4444
{
45-
"vlan": "Vlan1000",
45+
"port": "Vlan1000",
4646
"neigh": "00:02:02:03:04:05",
4747
"family": "IPv4"
4848
}
@@ -56,18 +56,73 @@
5656
"sonic-neigh:NEIGH": {
5757
"NEIGH_LIST": [
5858
{
59-
"vlan": "INVALIDVlan",
59+
"port": "INVALIDVlan",
6060
"neighbor": "100.1.1.3",
6161
"neigh": "00:02:02:03:04:05",
6262
"family": "IPv4"
6363
},
6464
{
65-
"vlan": "Vlan1000",
65+
"port": "Vlan1000",
6666
"neighbor": "100.1.1.4",
6767
"family": "IPv4"
6868
}
6969
]
7070
}
7171
}
72+
},
73+
74+
"VALID_NEIGH_PORTCHANNEL": {
75+
"sonic-neigh:sonic-neigh": {
76+
"sonic-neigh:NEIGH": {
77+
"NEIGH_LIST": [
78+
{
79+
"port": "PortChannel1024",
80+
"neighbor": "100.1.1.3",
81+
"neigh": "00:02:02:03:04:05",
82+
"family": "IPv4"
83+
},
84+
{
85+
"port": "PortChannel1024",
86+
"neighbor": "100.1.1.4",
87+
"family": "IPv4"
88+
}
89+
]
90+
}
91+
},
92+
"sonic-portchannel:sonic-portchannel": {
93+
"sonic-portchannel:PORTCHANNEL": {
94+
"PORTCHANNEL_LIST": [
95+
{
96+
"admin_status": "up",
97+
"name": "PortChannel1024"
98+
}
99+
]
100+
}
101+
}
102+
},
103+
104+
"NEIGH_INVALID_PORTCHANNEL": {
105+
"sonic-neigh:sonic-neigh": {
106+
"sonic-neigh:NEIGH": {
107+
"NEIGH_LIST": [
108+
{
109+
"port": "PortChannel10",
110+
"neighbor": "100.1.1.3",
111+
"neigh": "00:02:02:03:04:05",
112+
"family": "IPv4"
113+
}
114+
]
115+
}
116+
},
117+
"sonic-portchannel:sonic-portchannel": {
118+
"sonic-portchannel:PORTCHANNEL": {
119+
"PORTCHANNEL_LIST": [
120+
{
121+
"admin_status": "up",
122+
"name": "PortChannel11"
123+
}
124+
]
125+
}
126+
}
72127
}
73128
}

src/sonic-yang-models/yang-models/sonic-neigh.yang

+17-10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ module sonic-neigh {
1111
prefix yang;
1212
}
1313

14+
import sonic-portchannel {
15+
prefix lag;
16+
}
1417
// TODO: Uncomment the following lines when sonic-vlan.yang is available
1518
// import sonic-vlan {
1619
// prefix svlan;
@@ -29,18 +32,22 @@ module sonic-neigh {
2932
container NEIGH {
3033
description "NEIGH configuration";
3134
list NEIGH_LIST {
32-
key "vlan neighbor";
35+
key "port neighbor";
3336

34-
leaf vlan {
35-
// TODO: Remove the following lines when sonic-vlan.yang is available
36-
description "Neighbor Vlan interface ex. Vlan1000";
37-
type string {
38-
pattern "Vlan[0-9]+";
37+
leaf port {
38+
description "Neighbor interface ex. Vlan1000, PortChannel1024";
39+
type union {
40+
type leafref {
41+
path /lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name;
42+
}
43+
type string {
44+
pattern "Vlan[0-9]+";
45+
}
46+
// TODO: Uncomment the following lines when sonic-vlan.yang is available
47+
// type leafref {
48+
// path "/svlan:sonic-vlan/svlan:VLAN/svlan:VLAN_LIST/svlan:name";
49+
// }
3950
}
40-
// TODO: Uncomment the following lines when sonic-vlan.yang is available
41-
// type leafref {
42-
// path "/svlan:sonic-vlan/svlan:VLAN/svlan:VLAN_LIST/svlan:name";
43-
// }
4451
}
4552

4653
leaf neighbor {

0 commit comments

Comments
 (0)