Skip to content

Commit a9ec9e9

Browse files
committed
Adding local-users-passwords-reset feature service, YANG model and its tests
1 parent 95f317a commit a9ec9e9

File tree

6 files changed

+54
-0
lines changed

6 files changed

+54
-0
lines changed

files/build_templates/init_cfg.json.j2

+5
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@
134134
"special_class": "true"
135135
}
136136
},
137+
"LOCAL_USERS_PASSWORDS_RESET": {
138+
"global": {
139+
"state": "disabled"
140+
}
141+
},
137142
"SYSTEM_DEFAULTS" : {
138143
{%- if include_mux == "y" %}
139144
"mux_tunnel_egress_acl": {

src/sonic-yang-models/setup.py

+2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def run(self):
7979
data_files=[
8080
('yang-models', ['./yang-models/sonic-acl.yang',
8181
'./yang-models/sonic-auto_techsupport.yang',
82+
'./yang-models/sonic-local-users-passwords-reset',
8283
'./yang-models/sonic-bgp-common.yang',
8384
'./yang-models/sonic-bgp-device-global.yang',
8485
'./yang-models/sonic-bgp-global.yang',
@@ -192,6 +193,7 @@ def run(self):
192193
'./yang-models/sonic-macsec.yang',
193194
'./yang-models/sonic-bgp-sentinel.yang']),
194195
('cvlyang-models', ['./cvlyang-models/sonic-acl.yang',
196+
'./cvlyang-models/sonic-local-users-passwords-reset',
195197
'./cvlyang-models/sonic-bgp-common.yang',
196198
'./cvlyang-models/sonic-bgp-global.yang',
197199
'./cvlyang-models/sonic-bgp-monitor.yang',

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

+5
Original file line numberDiff line numberDiff line change
@@ -2487,6 +2487,11 @@
24872487
}
24882488
}
24892489
},
2490+
"LOCAL_USERS_PASSWORDS_RESET": {
2491+
"global": {
2492+
"state": "disabled"
2493+
}
2494+
},
24902495
"SAMPLE_CONFIG_DB_UNKNOWN": {
24912496
"UNKNOWN_TABLE": {
24922497
"Error": "This Table is for testing, This Table does not have YANG models."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"LOCAL_USERS_PASSWORDS_RESET_TEST_STATE": {
3+
"desc": "Configure Local users' passwords reset feature state."
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"LOCAL_USERS_PASSWORDS_RESET_TEST_STATE": {
3+
"sonic-local-users-passwords-reset:sonic-local-users-passwords-reset": {
4+
"sonic-local-users-passwords-reset:LOCAL_USERS_PASSWORDS_RESET": {
5+
"global": {
6+
"state": "enabled"
7+
}
8+
}
9+
}
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module local-users-passwords-reset {
2+
yang-version 1.1;
3+
namespace "http://github.com/sonic-net/local-users-passwords-reset";
4+
5+
import sonic-types {
6+
prefix stypes;
7+
}
8+
9+
description "LONG_RESET_BUTTON YANG Module for SONiC-based OS";
10+
revision 2024-01-04 {
11+
description "First Revision";
12+
}
13+
14+
container sonic-local-users-passwords-reset {
15+
container LOCAL_USERS_PASSWORDS_RESET {
16+
description "LOCAL_USERS_PASSWORDS_RESET part of config_db.json";
17+
container global {
18+
leaf state {
19+
type stypes:admin_mode;
20+
description "Local users' passwords reset feature state";
21+
default disabled;
22+
}
23+
} /* end of container global */
24+
} /* end of container LOCAL_USERS_PASSWORDS_RESET */
25+
} /* end of top level container */
26+
}

0 commit comments

Comments
 (0)