-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[YangModel][asic_sensors] Add ASIC_SENSORS yang models (#21218)
Why I did it Add Yang Models support for ASIC_SENSORS configuration. Work item tracking Microsoft ADO (number only): How I did it Add Yang Models support for the following ASIC_SENSORs configuration { "ASIC_SENSORS": { "ASIC_SENSORS_POLLER_INTERVAL": { "interval": "10" }, "ASIC_SENSORS_POLLER_STATUS": { "admin_status": "enable" } } } How to verify it Image Build should be passed. Signed-off-by: mlok <[email protected]>
- Loading branch information
1 parent
7bfba32
commit cb2286e
Showing
6 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/sonic-yang-models/tests/yang_model_tests/tests/asic-sensors.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"ASIC_SENSORS_TABLE": { | ||
"desc": "Config DB interval parameters for ASIC Sensors polling" | ||
}, | ||
"ASIC_SENSORS_INVALID_POLLER_INTERVAL": { | ||
"desc": "Configure an invalid ASIC Sensors polling interval", | ||
"eStrKey" : "Pattern" | ||
}, | ||
"ASIC_SENSORS_INVALID_POLLER_ADMIN_STATUS": { | ||
"desc": "Configure an invalid ASIC Sensors polling admin status", | ||
"eStrKey" : "InvalidValue" | ||
}, | ||
"ASIC_SENSORS_POLLER_INTERVAL_BAD_LEN_MAX": { | ||
"desc": "Configure an invalid ASIC Sensors polling interval: out of range value", | ||
"eStrKey" : "InvalidValue" | ||
}, | ||
"ASIC_SENSORS_POLLER_INTERVAL_EMPTY_VALUE": { | ||
"desc": "Configure an empty ASIC Sensors polling interval", | ||
"eStrKey" : "InvalidValue" | ||
}, | ||
"ASIC_SENSORS_POLLER_ADMIN_STATUS_EMPTY_VALUE": { | ||
"desc": "Configure an empty ASIC Sensors polling admin status", | ||
"eStrKey" : "InvalidValue" | ||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
src/sonic-yang-models/tests/yang_model_tests/tests_config/asic-sensors.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"ASIC_SENSORS_TABLE": { | ||
"sonic-asic-sensors:sonic-asic-sensors": { | ||
"sonic-asic-sensors:ASIC_SENSORS": { | ||
"ASIC_SENSORS_POLLER_INTERVAL": { | ||
"interval": "10" | ||
}, | ||
"ASIC_SENSORS_POLLER_STATUS": { | ||
"admin_status": "enable" | ||
} | ||
} | ||
} | ||
}, | ||
"ASIC_SENSORS_INVALID_POLLER_INTERVAL": { | ||
"sonic-asic-sensors:sonic-asic-sensors": { | ||
"sonic-asic-sensors:ASIC_SENSORS": { | ||
"ASIC_SENSORS_POLLER_INTERVAL": { | ||
"interval": "0" | ||
}, | ||
"ASIC_SENSORS_POLLER_STATUS": { | ||
"admin_status": "enable" | ||
} | ||
} | ||
} | ||
}, | ||
"ASIC_SENSORS_INVALID_POLLER_ADMIN_STATUS": { | ||
"sonic-asic-sensors:sonic-asic-sensors": { | ||
"sonic-asic-sensors:ASIC_SENSORS": { | ||
"ASIC_SENSORS_POLLER_INTERVAL": { | ||
"interval": "10" | ||
}, | ||
"ASIC_SENSORS_POLLER_STATUS": { | ||
"admin_status": "testing" | ||
} | ||
} | ||
} | ||
}, | ||
"ASIC_SENSORS_POLLER_INTERVAL_BAD_LEN_MAX": { | ||
"sonic-asic-sensors:sonic-asic-sensors": { | ||
"sonic-asic-sensors:ASIC_SENSORS": { | ||
"ASIC_SENSORS_POLLER_INTERVAL": { | ||
"interval": "1010101010101010101010" | ||
}, | ||
"ASIC_SENSORS_POLLER_STATUS": { | ||
"admin_status": "enable" | ||
} | ||
} | ||
} | ||
}, | ||
"ASIC_SENSORS_POLLER_INTERVAL_EMPTY_VALUE": { | ||
"sonic-asic-sensors:sonic-asic-sensors": { | ||
"sonic-asic-sensors:ASIC_SENSORS": { | ||
"ASIC_SENSORS_POLLER_INTERVAL": { | ||
"interval": "" | ||
}, | ||
"ASIC_SENSORS_POLLER_STATUS": { | ||
"admin_status": "enable" | ||
} | ||
} | ||
} | ||
}, | ||
"ASIC_SENSORS_POLLER_ADMIN_STATUS_EMPTY_VALUE": { | ||
"sonic-asic-sensors:sonic-asic-sensors": { | ||
"sonic-asic-sensors:ASIC_SENSORS": { | ||
"ASIC_SENSORS_POLLER_INTERVAL": { | ||
"interval": "10" | ||
}, | ||
"ASIC_SENSORS_POLLER_STATUS": { | ||
"admin_status": "" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
module sonic-asic-sensors { | ||
yang-version 1.1; | ||
namespace "http://github.com/sonic-net/sonic-asic-sensors"; | ||
prefix asic-sensors; | ||
|
||
import sonic-types { | ||
prefix stypes; | ||
} | ||
|
||
description "ASIC SENSORs config yang Module for SONiC OS"; | ||
|
||
revision 2024-11-19 { | ||
description "First Revision"; | ||
} | ||
|
||
container sonic-asic-sensors { | ||
container ASIC_SENSORS { | ||
description "ASIC_SENSORS part of config_db.json"; | ||
|
||
container ASIC_SENSORS_POLLER_INTERVAL { | ||
leaf interval { | ||
description "ASIC SENSORS polling interval"; | ||
type uint32 { | ||
range "1..999"; | ||
} | ||
units seconds; | ||
default "10 "; | ||
} | ||
} /* ASIC_SENSORS_POLLER_INTERVAL */ | ||
|
||
container ASIC_SENSORS_POLLER_STATUS { | ||
leaf admin_status { | ||
description "ASIC SENSORS polling administrative status"; | ||
type stypes:mode-status; | ||
default "enable"; | ||
} /* admin_status */ | ||
} /* ASIC_SENSORS_POLLER_STATUS */ | ||
|
||
} /* end of ASIC_SENSORS */ | ||
} /* end of container sonic-asic-sensors */ | ||
} /* end of module sonic-asic-sensors */ |