SONiC Yang for Warm Restart (#7698)

Why I did it
SONiC YANG model support for warm restart.

How I did it
Defined warm restart YANG containers and lists based on config-DB schema.

How to verify it
Successful build of the following packages:
make target/python-wheels/sonic_yang_models-1.0-py3-none-any.whl
make target/python-wheels/sonic_yang_mgmt-1.0-py3-none-any.whl

Signed-off-by: Arthi Sivanantham <arthi_sivanantham@dell.com>
This commit is contained in:
ArthiSivanantham 2021-09-28 08:51:26 -07:00 committed by GitHub
parent c770375b3f
commit ada8043ed3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 238 additions and 0 deletions

View File

@ -73,6 +73,7 @@ setup(
'./yang-models/sonic-versions.yang', './yang-models/sonic-versions.yang',
'./yang-models/sonic-vlan.yang', './yang-models/sonic-vlan.yang',
'./yang-models/sonic-vrf.yang', './yang-models/sonic-vrf.yang',
'./yang-models/sonic-warm-restart.yang',
'./yang-models/sonic-lldp.yang', './yang-models/sonic-lldp.yang',
'./yang-models/sonic_yang_tree']), './yang-models/sonic_yang_tree']),
], ],

View File

@ -879,6 +879,13 @@
"polling_interval": "0" "polling_interval": "0"
} }
}, },
"WARM_RESTART": {
"bgp": {
"bgp_timer": "500"
}
},
"PFC_WD": { "PFC_WD": {
"Ethernet9": { "Ethernet9": {
"action": "drop", "action": "drop",

View File

@ -0,0 +1,33 @@
{
"WARM_RESTART_TEST": {
"desc": "Configure an entry in WARM_RESTART table."
},
"WARM_RESTART_WITH_MUST_CONDITION_FAILURE_TEST_FOR_BGP_EOIU": {
"desc": "Configuration of bgp eoiu with incorrect module name.",
"eStr" : ["bgp_eoiu is only supported for module bgp"]
},
"WARM_RESTART_WITH_MUST_CONDITION_FAILURE_TEST_FOR_BGP_TIMER": {
"desc": "Configuration of bgp timer with incorrect module name.",
"eStr" : ["bgp_timer is only supported for module bgp"]
},
"WARM_RESTART_WITH_MUST_CONDITION_FAILURE_TEST_FOR_TEAMSYNCD_TIMER": {
"desc": "Configuration of teamsyncd timer with incorrect module name.",
"eStr" : ["teamsyncd_timer is only supported for module teamd"]
},
"WARM_RESTART_WITH_MUST_CONDITION_FAILURE_TEST_FOR_NEIGHSYNCD_TIMER": {
"desc": "Configuration of neighsyncd timer with incorrect module name.",
"eStr" : ["neighsyncd_timer is only supported for module swss"]
},
"WARM_RESTART_TEST_WITH_INCORRECT_BGP_TIMER": {
"desc": "Configure Warm restart for bgp module with an out of range bgp timer.",
"eStr": ["Timer must be 1..3600"]
},
"WARM_RESTART_TEST_WITH_INCORRECT_TEAMSYNCD_TIMER": {
"desc": "Configure Warm restart for teamsyncd module with an out of range teamsyncd timer.",
"eStr": ["Timer must be 1..3600"]
},
"WARM_RESTART_TEST_WITH_INCORRECT_NEIGHSYNCD_TIMER": {
"desc": "Configure Warm restart for neighsyncd module with an out of range neighsyncd timer.",
"eStr": ["Timer must be 1..9999"]
}
}

View File

@ -0,0 +1,92 @@
{
"WARM_RESTART_TEST": {
"sonic-warm-restart:sonic-warm-restart": {
"sonic-warm-restart:WARM_RESTART": {
"WARM_RESTART_LIST": [{
"module": "bgp",
"bgp_eoiu": true,
"bgp_timer": 500
}]
}
}
},
"WARM_RESTART_WITH_MUST_CONDITION_FAILURE_TEST_FOR_BGP_EOIU": {
"sonic-warm-restart:sonic-warm-restart": {
"sonic-warm-restart:WARM_RESTART": {
"WARM_RESTART_LIST": [{
"module": "teamd",
"bgp_eoiu": true
}]
}
}
},
"WARM_RESTART_WITH_MUST_CONDITION_FAILURE_TEST_FOR_BGP_TIMER": {
"sonic-warm-restart:sonic-warm-restart": {
"sonic-warm-restart:WARM_RESTART": {
"WARM_RESTART_LIST": [{
"module": "teamd",
"bgp_timer": 500
}]
}
}
},
"WARM_RESTART_WITH_MUST_CONDITION_FAILURE_TEST_FOR_TEAMSYNCD_TIMER": {
"sonic-warm-restart:sonic-warm-restart": {
"sonic-warm-restart:WARM_RESTART": {
"WARM_RESTART_LIST": [{
"module": "bgp",
"teamsyncd_timer": 500
}]
}
}
},
"WARM_RESTART_WITH_MUST_CONDITION_FAILURE_TEST_FOR_NEIGHSYNCD_TIMER": {
"sonic-warm-restart:sonic-warm-restart": {
"sonic-warm-restart:WARM_RESTART": {
"WARM_RESTART_LIST": [{
"module": "bgp",
"neighsyncd_timer": 500
}]
}
}
},
"WARM_RESTART_TEST_WITH_INCORRECT_BGP_TIMER": {
"sonic-warm-restart:sonic-warm-restart": {
"sonic-warm-restart:WARM_RESTART": {
"WARM_RESTART_LIST": [{
"module": "bgp",
"bgp_timer": 3601
}]
}
}
},
"WARM_RESTART_TEST_WITH_INCORRECT_TEAMSYNCD_TIMER": {
"sonic-warm-restart:sonic-warm-restart": {
"sonic-warm-restart:WARM_RESTART": {
"WARM_RESTART_LIST": [{
"module": "teamd",
"teamsyncd_timer": 3601
}]
}
}
},
"WARM_RESTART_TEST_WITH_INCORRECT_NEIGHSYNCD_TIMER": {
"sonic-warm-restart:sonic-warm-restart": {
"sonic-warm-restart:WARM_RESTART": {
"WARM_RESTART_LIST": [{
"module": "swss",
"neighsyncd_timer": 0
}]
}
}
}
}

View File

@ -0,0 +1,105 @@
module sonic-warm-restart {
yang-version 1.1;
namespace "http://github.com/Azure/sonic-warm-restart";
prefix wrm;
description "SONIC WARMRESTART";
revision 2021-05-24 {
description "First Revision";
}
typedef module-name {
type enumeration {
enum bgp {
description
"BGP module";
}
enum teamd {
description
"Teamd module";
}
enum swss {
description
"Switch State Services module";
}
enum system {
description
"Warm Restart on a System level.";
}
}
description
"The modules supported in warm-restart";
}
container sonic-warm-restart {
container WARM_RESTART {
list WARM_RESTART_LIST {
key "module";
leaf module {
type module-name;
description
"Name of the module";
}
leaf bgp_eoiu {
type boolean;
must "current()/../module = 'bgp'" { error-message "bgp_eoiu is only supported for module bgp."; }
description
"BGP End-of-Initial Update (EOIU) signal enable/disable";
}
leaf bgp_timer {
type uint16 {
range "1..3600" {
error-message "Timer must be 1..3600";
error-app-tag timer-invalid;
}
}
must "current()/../module = 'bgp'" { error-message "bgp_timer is only supported for module bgp."; }
description
"Timer value for BGP module";
}
leaf teamsyncd_timer {
type uint16 {
range "1..3600" {
error-message "Timer must be 1..3600";
error-app-tag timer-invalid;
}
}
must "current()/../module = 'teamd'" { error-message "teamsyncd_timer is only supported for module teamd."; }
description
"Timer value for teamd module";
}
leaf neighsyncd_timer {
type uint16 {
range "1..9999" {
error-message "Timer must be 1..9999";
error-app-tag timer-invalid;
}
}
must "current()/../module = 'swss'" { error-message "neighsyncd_timer is only supported for module swss."; }
description
"Timer value for swss module";
}
} /* end of list WARM_RESTART_LIST */
} /* end of container WARM_RESTART */
} /* end of container sonic-warm-restart */
} /* end of module sonic-warm-restart */