Skip to content

Commit

Permalink
DPB: update crm yang model for dynamic port breakout
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytroxshevchuk committed Jan 20, 2021
1 parent 3a942fb commit 27326cd
Show file tree
Hide file tree
Showing 3 changed files with 253 additions and 15 deletions.
43 changes: 43 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 @@ -186,6 +186,10 @@ def initTest(self):
about high threshold being lower than low threshold.',
'eStr': ['high_threshold should be more than low_threshold']
},
'CRM_WITH_WRONG_THRESHOLD_TYPE': {
'desc': 'CRM_WITH_WRONG_THRESHOLD_TYPE must condition failure.',
'eStr': self.defaultYANGFailure['None']
},
'CRM_WITH_CORRECT_USED_VALUE': {
'desc': 'CRM_WITH_CORRECT_USED_VALUE no failure.',
'eStr': self.defaultYANGFailure['None']
Expand Down Expand Up @@ -229,6 +233,45 @@ 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_WRONG_THRESHOLD_TYPE': {
'desc': 'SNAT_WITH_WRONG_THRESHOLD_TYPE must condition failure.',
'eStr': self.defaultYANGFailure['None']
},
'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_WRONG_THRESHOLD_TYPE': {
'desc': 'DNAT_WITH_WRONG_THRESHOLD_TYPE must condition failure.',
'eStr': self.defaultYANGFailure['None']
},
'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_WRONG_THRESHOLD_TYPE': {
'desc': 'IPMC_WITH_WRONG_THRESHOLD_TYPE must condition failure.',
'eStr': self.defaultYANGFailure['None']
}
}

Expand Down
141 changes: 138 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 @@ -800,12 +800,12 @@
}
},

"CRM_WITH_WRONG_THRESHOLD": {
"CRM_WITH_WRONG_THRESHOLD_TYPE": {
"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 @@ -824,6 +824,114 @@
}
},

"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_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": "free"
}
}
}
},

"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_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": "free"
}
}
}
},

"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_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": "free"
}
}
}
},

"DEVICE_METADATA_DEFAULT_BGP_STATUS": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
Expand Down Expand Up @@ -926,6 +1034,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 @@ -1716,6 +1833,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 +1869,15 @@
"acl_counter_high_threshold": "85",
"acl_counter_low_threshold": "70",
"acl_counter_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 27326cd

Please sign in to comment.