Skip to content

Commit

Permalink
[yang] add Yang model for XCVRD_LOG|Y_CABLE (#20496)
Browse files Browse the repository at this point in the history
#### Why I did it


Adding yang model for CONFIG_DB table XCVRD_LOG|Y_CABLE.
Introduced by 
https://github.com/sonic-net/sonic-utilities/blob/master/config/muxcable.py#L1230-L1235

#### How I did it
Added the changes in sonic-yang-models
#### How to verify it
UT test 

```
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.9.2, pytest-6.0.2, py-1.10.0, pluggy-0.13.0
rootdir: /sonic/src/sonic-yang-models
plugins: pyfakefs-5.2.3, cov-2.10.1
collected 3 items                                                                                                                                                                           

tests/test_sonic_yang_models.py ..                                                                                                                                                    [ 66%]
tests/yang_model_tests/test_yang_model.py .                                                                                                                                           [100%]

===================================================================================== 3 passed in 2.06s =====================================================================================
```
  • Loading branch information
vdahiya12 authored Oct 29, 2024
1 parent a5a9dac commit d6d8c57
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Table of Contents
* [Virtual router](#virtual-router)
* [LOGGER](#logger)
* [WRED_PROFILE](#wred_profile)
* [XCVRD_LOG](#xcvrd_log)
* [PASSWORD_HARDENING](#password_hardening)
* [SSH_SERVER](#ssh_server)
* [SYSTEM_DEFAULTS table](#systemdefaults-table)
Expand Down
1 change: 1 addition & 0 deletions src/sonic-yang-models/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def run(self):
'./yang-models/sonic-macsec.yang',
'./yang-models/sonic-bgp-sentinel.yang',
'./yang-models/sonic-bmp.yang',
'./yang-models/sonic-xcvrd-log.yang',
'./yang-models/sonic-serial-console.yang',
'./yang-models/sonic-smart-switch.yang',]),
('cvlyang-models', ['./cvlyang-models/sonic-acl.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 @@ -2744,6 +2744,11 @@
"midplane_interface": "dpu1"
}
},
"XCVRD_LOG": {
"Y_CABLE": {
"log_verbosity": "notice"
}
},
"BANNER_MESSAGE": {
"global": {
"state": "enabled",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"XCVRD_LOG_Y_CABLE_CHANGE_VERBOSITY_LEVEL": {
"desc": "Consume verbosity level config changes. "
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"XCVRD_LOG_Y_CABLE_CHANGE_VERBOSITY_LEVEL": {
"sonic-xcvrd-log:sonic-xcvrd-log": {
"sonic-xcvrd-log:XCVRD_LOG": {
"sonic-xcvrd-log:Y_CABLE":
{
"log_verbosity": "debug"
}
}
}
}
}
41 changes: 41 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-xcvrd-log.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module sonic-xcvrd-log {
namespace "http://github.com/sonic-net/sonic-xcvrd-log";
prefix xcvrd_log;
yang-version 1.1;

organization
"SONiC";

contact
"SONiC";

description
"SONiC DualToR xcvrd logging configuration data";

revision 2024-10-14 {
description
"Initial revision";
}

container sonic-xcvrd-log {

container XCVRD_LOG {

container Y_CABLE {

leaf log_verbosity {
type enumeration {
enum info;
enum notice;
enum debug;
enum warning;
enum critical;
}

description "xcvrd log verbosity level. ";

}
}
}
}
}

0 comments on commit d6d8c57

Please sign in to comment.