Skip to content

Commit 32b0880

Browse files
committed
Fix comments
Fix comments Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
1 parent c77e210 commit 32b0880

File tree

6 files changed

+67
-12
lines changed

6 files changed

+67
-12
lines changed

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

+16
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
* [XCVRD_LOG](#xcvrd_log)
8888
* [PASSWORD_HARDENING](#password_hardening)
8989
* [SSH_SERVER](#ssh_server)
90+
* [SUBNET_DECAP](#subnet_decap)
9091
* [SYSTEM_DEFAULTS table](#systemdefaults-table)
9192
* [RADIUS](#radius)
9293
* [Static DNS](#static-dns)
@@ -95,6 +96,7 @@
9596
* [Incremental Configuration by Subscribing to ConfigDB](#incremental-configuration-by-subscribing-to-configdb)
9697

9798

99+
98100
# Introduction
99101
This document lists the configuration commands schema applied in the SONiC eco system. All these commands find relevance in collecting system information, analysis and even for trouble shooting. All the commands are categorized under relevant topics with corresponding examples.
100102

@@ -2809,6 +2811,20 @@ The method could be:
28092811
}
28102812
```
28112813
2814+
### SUBNET_DECAP
2815+
2816+
The **SUBNET_DECAP** table is used for subnet decap configuration.
2817+
2818+
```
2819+
"SUBNET_DECAP": {
2820+
"AZURE": {
2821+
"status": "enable",
2822+
"src_ip": "10.10.10.0/24",
2823+
"src_ip_v6": "20c1:ba8::/64"
2824+
}
2825+
}
2826+
```
2827+
28122828
### SYSTEM_DEFAULTS table
28132829
To have a better management of the features in SONiC, a new table `SYSTEM_DEFAULTS` is introduced.
28142830

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": {},
@@ -2765,13 +2772,6 @@
27652772
"log_verbosity": "notice"
27662773
}
27672774
},
2768-
"SUBNET_DECAP": {
2769-
"AZURE": {
2770-
"status": "enable",
2771-
"src_ip": "10.10.10.0/24",
2772-
"src_ip_v6": "20c1:ba8::/64"
2773-
}
2774-
},
27752775
"GRPCCLIENT": {
27762776
"config": {
27772777
"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)