Skip to content

Commit

Permalink
Adding local-users-passwords-reset feature service, YANG model and it…
Browse files Browse the repository at this point in the history
…s tests
  • Loading branch information
azmyali98 committed May 6, 2024
1 parent 95f317a commit a9ec9e9
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 0 deletions.
5 changes: 5 additions & 0 deletions files/build_templates/init_cfg.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@
"special_class": "true"
}
},
"LOCAL_USERS_PASSWORDS_RESET": {
"global": {
"state": "disabled"
}
},
"SYSTEM_DEFAULTS" : {
{%- if include_mux == "y" %}
"mux_tunnel_egress_acl": {
Expand Down
2 changes: 2 additions & 0 deletions src/sonic-yang-models/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def run(self):
data_files=[
('yang-models', ['./yang-models/sonic-acl.yang',
'./yang-models/sonic-auto_techsupport.yang',
'./yang-models/sonic-local-users-passwords-reset',
'./yang-models/sonic-bgp-common.yang',
'./yang-models/sonic-bgp-device-global.yang',
'./yang-models/sonic-bgp-global.yang',
Expand Down Expand Up @@ -192,6 +193,7 @@ def run(self):
'./yang-models/sonic-macsec.yang',
'./yang-models/sonic-bgp-sentinel.yang']),
('cvlyang-models', ['./cvlyang-models/sonic-acl.yang',
'./cvlyang-models/sonic-local-users-passwords-reset',
'./cvlyang-models/sonic-bgp-common.yang',
'./cvlyang-models/sonic-bgp-global.yang',
'./cvlyang-models/sonic-bgp-monitor.yang',
Expand Down
5 changes: 5 additions & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -2487,6 +2487,11 @@
}
}
},
"LOCAL_USERS_PASSWORDS_RESET": {
"global": {
"state": "disabled"
}
},
"SAMPLE_CONFIG_DB_UNKNOWN": {
"UNKNOWN_TABLE": {
"Error": "This Table is for testing, This Table does not have YANG models."
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"LOCAL_USERS_PASSWORDS_RESET_TEST_STATE": {
"desc": "Configure Local users' passwords reset feature state."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"LOCAL_USERS_PASSWORDS_RESET_TEST_STATE": {
"sonic-local-users-passwords-reset:sonic-local-users-passwords-reset": {
"sonic-local-users-passwords-reset:LOCAL_USERS_PASSWORDS_RESET": {
"global": {
"state": "enabled"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module local-users-passwords-reset {
yang-version 1.1;
namespace "http://github.com/sonic-net/local-users-passwords-reset";

import sonic-types {
prefix stypes;
}

description "LONG_RESET_BUTTON YANG Module for SONiC-based OS";
revision 2024-01-04 {
description "First Revision";
}

container sonic-local-users-passwords-reset {
container LOCAL_USERS_PASSWORDS_RESET {
description "LOCAL_USERS_PASSWORDS_RESET part of config_db.json";
container global {
leaf state {
type stypes:admin_mode;
description "Local users' passwords reset feature state";
default disabled;
}
} /* end of container global */
} /* end of container LOCAL_USERS_PASSWORDS_RESET */
} /* end of top level container */
}

0 comments on commit a9ec9e9

Please sign in to comment.