-
Notifications
You must be signed in to change notification settings - Fork 1.6k
SONiC Yang for Warm Restart #7698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ac17433
SONiC Yang for Warm Restart
0ae478a
Merge branch 'master' into sonic_warmrestart
e418ff0
Update descriptions
cef8f1c
Merge branch 'master' into sonic_warmrestart
12ccecf
Fix merge conflicts
0eec5eb
Merge branch 'master' into sonic_warmrestart
865cf0b
Merge branch 'master' into sonic_warmrestart
348e91e
Fix bgp, neighsyncd and teamsyncd timers in sonic warmrestart yang
86bf7b3
Fix warm restart test values
bedb8e2
Fix error messages in warm restart tests
59a331a
Merge branch 'master' into sonic_warmrestart
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
33 changes: 33 additions & 0 deletions
33
src/sonic-yang-models/tests/yang_model_tests/tests/warm_restart.json
This file contains hidden or 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,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"] | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
src/sonic-yang-models/tests/yang_model_tests/tests_config/warm_restart.json
This file contains hidden or 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,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 | ||
}] | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
105 changes: 105 additions & 0 deletions
105
src/sonic-yang-models/yang-models/sonic-warm-restart.yang
This file contains hidden or 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,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 */ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.