Skip to content

Commit

Permalink
[yang] update crm yang model for dynamic port breakout (#6395)
Browse files Browse the repository at this point in the history
- Why I did it
Fix DPB crash caused of new entries in config db.
Details: #6331

- How I did it
Updated crm yang model
  • Loading branch information
dmytroxshevchuk authored Feb 24, 2021
1 parent 51eee8c commit 3abd216
Show file tree
Hide file tree
Showing 3 changed files with 356 additions and 15 deletions.
71 changes: 71 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/test_yang_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,18 @@ def initTest(self):
about high threshold being lower than low threshold.',
'eStr': ['high_threshold should be more than low_threshold']
},
'CRM_WITH_CORRECT_FREE_VALUE': {
'desc': 'CRM_WITH_CORRECT_FREE_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'CRM_WITH_CORRECT_USED_VALUE': {
'desc': 'CRM_WITH_CORRECT_USED_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'CRM_WITH_WRONG_THRESHOLD_TYPE': {
'desc': 'CRM_WITH_WRONG_THRESHOLD_TYPE pattern failure.',
'eStr': self.defaultYANGFailure['Pattern'] + ['wrong']
},
'FLEX_COUNTER_TABLE_WITH_CORRECT_USED_VALUE': {
'desc': 'FLEX_COUNTER_TABLE_WITH_CORRECT_USED_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
Expand Down Expand Up @@ -241,6 +249,69 @@ def initTest(self):
'BREAKOUT_CFG_INCORRECT_MODES': {
'desc': 'BREAKOUT_CFG wrong breakout modes',
'eStr': self.defaultYANGFailure['Pattern']
},
'SNAT_WITH_WRONG_PERCENTAGE': {
'desc': 'SNAT_WITH_WRONG_PERCENTAGE must condition failure.',
'eStr': self.defaultYANGFailure['Must']
},
'SNAT_WITH_HIGH_THRESHOLD_ERR': {
'desc': 'SNAT_WITH_HIGH_THRESHOLD_ERR must condition failure \
about high threshold being lower than low threshold.',
'eStr': ['high_threshold should be more than low_threshold']
},
'SNAT_WITH_CORRECT_FREE_VALUE': {
'desc': 'SNAT_WITH_CORRECT_FREE_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'SNAT_WITH_CORRECT_USED_VALUE': {
'desc': 'SNAT_WITH_CORRECT_USED_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'SNAT_WITH_WRONG_THRESHOLD_TYPE': {
'desc': 'SNAT_WITH_WRONG_THRESHOLD_TYPE pattern failure.',
'eStr': self.defaultYANGFailure['Pattern'] + ['wrong']
},
'DNAT_WITH_WRONG_PERCENTAGE': {
'desc': 'DNAT_WITH_WRONG_PERCENTAGE must condition failure.',
'eStr': self.defaultYANGFailure['Must']
},
'DNAT_WITH_HIGH_THRESHOLD_ERR': {
'desc': 'DNAT_WITH_HIGH_THRESHOLD_ERR must condition failure \
about high threshold being lower than low threshold.',
'eStr': ['high_threshold should be more than low_threshold']
},
'DNAT_WITH_CORRECT_FREE_VALUE': {
'desc': 'DNAT_WITH_CORRECT_FREE_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'DNAT_WITH_CORRECT_USED_VALUE': {
'desc': 'DNAT_WITH_CORRECT_USED_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'DNAT_WITH_WRONG_THRESHOLD_TYPE': {
'desc': 'DNAT_WITH_WRONG_THRESHOLD_TYPE pattern failure.',
'eStr': self.defaultYANGFailure['Pattern'] + ['wrong']
},
'IPMC_WITH_WRONG_PERCENTAGE': {
'desc': 'IPMC_WITH_WRONG_PERCENTAGE must condition failure.',
'eStr': self.defaultYANGFailure['Must']
},
'IPMC_WITH_HIGH_THRESHOLD_ERR': {
'desc': 'IPMC_WITH_HIGH_THRESHOLD_ERR must condition failure \
about high threshold being lower than low threshold.',
'eStr': ['high_threshold should be more than low_threshold']
},
'IPMC_WITH_CORRECT_FREE_VALUE': {
'desc': 'IPMC_WITH_CORRECT_FREE_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'IPMC_WITH_CORRECT_USED_VALUE': {
'desc': 'IPMC_WITH_CORRECT_USED_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
},
'IPMC_WITH_WRONG_THRESHOLD_TYPE': {
'desc': 'IPMC_WITH_WRONG_THRESHOLD_TYPE pattern failure.',
'eStr': self.defaultYANGFailure['Pattern'] + ['wrong']
}
}

Expand Down
216 changes: 213 additions & 3 deletions src/sonic-yang-models/tests/yang_model_tests/yangTest.json
Original file line number Diff line number Diff line change
Expand Up @@ -814,12 +814,12 @@
}
},

"CRM_WITH_WRONG_THRESHOLD": {
"CRM_WITH_CORRECT_FREE_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"acl_counter_high_threshold": 85,
"acl_counter_low_threshold": 90,
"acl_counter_high_threshold": 90,
"acl_counter_low_threshold": 70,
"acl_counter_threshold_type": "free"
}
}
Expand All @@ -838,6 +838,198 @@
}
},

"CRM_WITH_WRONG_THRESHOLD_TYPE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"acl_counter_high_threshold": 90,
"acl_counter_low_threshold": 70,
"acl_counter_threshold_type": "wrong"
}
}
}
},

"SNAT_WITH_WRONG_PERCENTAGE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"snat_entry_high_threshold": 110,
"snat_entry_low_threshold": 85,
"snat_entry_threshold_type": "PERCENTAGE"
}
}
}
},

"SNAT_WITH_HIGH_THRESHOLD_ERR": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"snat_entry_high_threshold": 80,
"snat_entry_low_threshold": 81,
"snat_entry_threshold_type": "PERCENTAGE"
}
}
}
},

"SNAT_WITH_CORRECT_FREE_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"snat_entry_high_threshold": 90,
"snat_entry_low_threshold": 70,
"snat_entry_threshold_type": "free"
}
}
}
},

"SNAT_WITH_CORRECT_USED_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"snat_entry_high_threshold": 85,
"snat_entry_low_threshold": 25,
"snat_entry_threshold_type": "used"
}
}
}
},

"SNAT_WITH_WRONG_THRESHOLD_TYPE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"snat_entry_high_threshold": 90,
"snat_entry_low_threshold": 70,
"snat_entry_threshold_type": "wrong"
}
}
}
},

"DNAT_WITH_WRONG_PERCENTAGE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"dnat_entry_high_threshold": 110,
"dnat_entry_low_threshold": 85,
"dnat_entry_threshold_type": "PERCENTAGE"
}
}
}
},

"DNAT_WITH_HIGH_THRESHOLD_ERR": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"dnat_entry_high_threshold": 80,
"dnat_entry_low_threshold": 81,
"dnat_entry_threshold_type": "PERCENTAGE"
}
}
}
},

"DNAT_WITH_CORRECT_FREE_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"dnat_entry_high_threshold": 90,
"dnat_entry_low_threshold": 70,
"dnat_entry_threshold_type": "free"
}
}
}
},

"DNAT_WITH_CORRECT_USED_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"dnat_entry_high_threshold": 85,
"dnat_entry_low_threshold": 25,
"dnat_entry_threshold_type": "used"
}
}
}
},

"DNAT_WITH_WRONG_THRESHOLD_TYPE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"dnat_entry_high_threshold": 90,
"dnat_entry_low_threshold": 70,
"dnat_entry_threshold_type": "wrong"
}
}
}
},

"IPMC_WITH_WRONG_PERCENTAGE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"ipmc_entry_high_threshold": 110,
"ipmc_entry_low_threshold": 85,
"ipmc_entry_threshold_type": "PERCENTAGE"
}
}
}
},

"IPMC_WITH_HIGH_THRESHOLD_ERR": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"ipmc_entry_high_threshold": 80,
"ipmc_entry_low_threshold": 81,
"ipmc_entry_threshold_type": "PERCENTAGE"
}
}
}
},

"IPMC_WITH_CORRECT_FREE_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"ipmc_entry_high_threshold": 90,
"ipmc_entry_low_threshold": 70,
"ipmc_entry_threshold_type": "free"
}
}
}
},

"IPMC_WITH_CORRECT_USED_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"ipmc_entry_high_threshold": 85,
"ipmc_entry_low_threshold": 25,
"ipmc_entry_threshold_type": "used"
}
}
}
},

"IPMC_WITH_WRONG_THRESHOLD_TYPE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"ipmc_entry_high_threshold": 90,
"ipmc_entry_low_threshold": 70,
"ipmc_entry_threshold_type": "wrong"
}
}
}
},

"DEVICE_METADATA_DEFAULT_BGP_STATUS": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
Expand Down Expand Up @@ -953,6 +1145,15 @@
"nexthop_group_high_threshold": "67",
"nexthop_group_low_threshold": "56",
"nexthop_group_threshold_type": "percentage",
"snat_entry_threshold_type": "percentage",
"snat_entry_low_threshold": "70",
"snat_entry_high_threshold": "85",
"dnat_entry_threshold_type": "percentage",
"dnat_entry_low_threshold": "70",
"dnat_entry_high_threshold": "85",
"ipmc_entry_threshold_type": "percentage",
"ipmc_entry_low_threshold": "70",
"ipmc_entry_high_threshold": "85",
"polling_interval": "0"
}
}
Expand Down Expand Up @@ -1743,6 +1944,15 @@
"nexthop_group_high_threshold": "67",
"nexthop_group_low_threshold": "56",
"nexthop_group_threshold_type": "percentage",
"snat_entry_threshold_type": "percentage",
"snat_entry_low_threshold": "70",
"snat_entry_high_threshold": "85",
"dnat_entry_threshold_type": "percentage",
"dnat_entry_low_threshold": "70",
"dnat_entry_high_threshold": "85",
"ipmc_entry_threshold_type": "percentage",
"ipmc_entry_low_threshold": "70",
"ipmc_entry_high_threshold": "85",
"polling_interval": "0"
}
}
Expand Down
Loading

0 comments on commit 3abd216

Please sign in to comment.