Skip to content

Commit 73f34fa

Browse files
committed
Fix comments
Fix comments Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
1 parent 906ab3e commit 73f34fa

File tree

6 files changed

+66
-12
lines changed

6 files changed

+66
-12
lines changed

src/sonic-yang-models/doc/Configuration.md

+15
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ Table of Contents
9191
* [XCVRD_LOG](#xcvrd_log)
9292
* [PASSWORD_HARDENING](#password_hardening)
9393
* [SSH_SERVER](#ssh_server)
94+
* [SUBNET_DECAP](#subnet_decap)
9495
* [SYSTEM_DEFAULTS table](#systemdefaults-table)
9596
* [RADIUS](#radius)
9697
* [Static DNS](#static-dns)
@@ -2814,6 +2815,20 @@ The method could be:
28142815
}
28152816
```
28162817
2818+
### SUBNET_DECAP
2819+
2820+
The **SUBNET_DECAP** table is used for subnet decap configuration.
2821+
2822+
```
2823+
"SUBNET_DECAP": {
2824+
"AZURE": {
2825+
"status": "enable",
2826+
"src_ip": "10.10.10.0/24",
2827+
"src_ip_v6": "20c1:ba8::/64"
2828+
}
2829+
}
2830+
```
2831+
28172832
### SYSTEM_DEFAULTS table
28182833
To have a better management of the features in SONiC, a new table `SYSTEM_DEFAULTS` is introduced.
28192834

src/sonic-yang-models/setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def run(self):
167167
'./yang-models/sonic-system-tacacs.yang',
168168
'./yang-models/sonic-system-radius.yang',
169169
'./yang-models/sonic-system-ldap.yang',
170+
'./yang-models/sonic-subnet-decap.yang',
170171
'./yang-models/sonic-telemetry.yang',
171172
'./yang-models/sonic-telemetry_client.yang',
172173
'./yang-models/sonic-gnmi.yang',

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
"vni" : "100"
66
}
77
},
8+
"SUBNET_DECAP": {
9+
"AZURE": {
10+
"status": "enable",
11+
"src_ip": "10.10.10.0/24",
12+
"src_ip_v6": "20c1:ba8::/64"
13+
}
14+
},
815
"DHCP_SERVER": {
916
"192.0.0.8": {},
1017
"192.0.0.8": {},
@@ -2762,13 +2769,6 @@
27622769
"log_verbosity": "notice"
27632770
}
27642771
},
2765-
"SUBNET_DECAP": {
2766-
"AZURE": {
2767-
"status": "enable",
2768-
"src_ip": "10.10.10.0/24",
2769-
"src_ip_v6": "20c1:ba8::/64"
2770-
}
2771-
},
27722772
"GRPCCLIENT": {
27732773
"config": {
27742774
"type": "secure",

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

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"SUBNET_DECAP_INVALID_STATUS_TEST": {
1212
"desc": "Configure SUBNET_DECAP table with invalid status.",
13-
"eStrKey": "Pattern"
13+
"eStrKey": "InvalidValue"
1414
},
1515
"SUBNET_DECAP_INVALID_IPV4": {
1616
"desc": "Configure SUBNET_DECAP table with invalid src ipv4 prefix.",
@@ -19,5 +19,13 @@
1919
"SUBNET_DECAP_INVALID_IPV6": {
2020
"desc": "Configure SUBNET_DECAP table with invalid src ipv6 prefix.",
2121
"eStrKey": "Pattern"
22+
},
23+
"SUBNET_DECAP_NO_IPV4": {
24+
"desc": "Configure SUBNET_DECAP table without src ipv4 prefix.",
25+
"eStrKey": "Mandatory"
26+
},
27+
"SUBNET_DECAP_NO_IPV6": {
28+
"desc": "Configure SUBNET_DECAP table without src ipv6 prefix.",
29+
"eStrKey": "Mandatory"
2230
}
2331
}

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

+26
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,31 @@
8181
]
8282
}
8383
}
84+
},
85+
"SUBNET_DECAP_NO_IPV4": {
86+
"sonic-subnet-decap:sonic-subnet-decap": {
87+
"sonic-subnet-decap:SUBNET_DECAP": {
88+
"SUBNET_DECAP_LIST": [
89+
{
90+
"name": "AZURE",
91+
"status": "enable",
92+
"src_ip_v6": "20c1:ba8::/64"
93+
}
94+
]
95+
}
96+
}
97+
},
98+
"SUBNET_DECAP_NO_IPV6": {
99+
"sonic-subnet-decap:sonic-subnet-decap": {
100+
"sonic-subnet-decap:SUBNET_DECAP": {
101+
"SUBNET_DECAP_LIST": [
102+
{
103+
"name": "AZURE",
104+
"status": "enable",
105+
"src_ip": "10.10.10.0/24"
106+
}
107+
]
108+
}
109+
}
84110
}
85111
}

src/sonic-yang-models/yang-models/sonic-subnet-decap.yang

+8-4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ module sonic-subnet-decap {
1010
prefix inet;
1111
}
1212

13+
import sonic-types {
14+
prefix stypes;
15+
}
16+
1317
description "Subnet decap configuration for SONiC OS.";
1418

1519
revision 2024-12-19 {
@@ -31,21 +35,21 @@ module sonic-subnet-decap {
3135
}
3236

3337
leaf status {
34-
type string {
35-
pattern "enable|disable";
36-
}
37-
default "disable";
38+
type stypes:mode-status;
39+
default disable;
3840
description "Subnet Decap status.";
3941
}
4042

4143
leaf src_ip {
4244
type inet:ipv4-prefix;
4345
description "Subnet decap term source IPv4 prefix.";
46+
mandatory true;
4447
}
4548

4649
leaf src_ip_v6 {
4750
type inet:ipv6-prefix;
4851
description "Subnet decap term source IPv6 prefix.";
52+
mandatory true;
4953
}
5054
}
5155
}

0 commit comments

Comments
 (0)