Skip to content

Commit

Permalink
Test divide by zero processing path (#2028)
Browse files Browse the repository at this point in the history
*Test divide by zero processing path. Add vs test coverage for #1569
Signed-off-by: Wenda Ni <[email protected]>
  • Loading branch information
wendani authored Nov 16, 2021
1 parent 8f1d035 commit 708e232
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_crm.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,26 @@ def test_CrmAcl(self, dvs, testlog):

old_table_used_counter = getCrmCounterValue(dvs, 'ACL_STATS:INGRESS:PORT', 'crm_stats_acl_table_used')

value = {
"count": 1,
"list": [
{
"stage": "SAI_ACL_STAGE_INGRESS",
"bind_point": "SAI_ACL_BIND_POINT_TYPE_PORT",
"avail_num": "4294967295"
}
]
}
dvs.setReadOnlyAttr('SAI_OBJECT_TYPE_SWITCH', 'SAI_SWITCH_ATTR_AVAILABLE_ACL_TABLE', json.dumps(value))
time.sleep(2)

marker = dvs.add_log_marker()
# create ACL table
ttbl = swsscommon.Table(db, "ACL_TABLE")
fvs = swsscommon.FieldValuePairs([("policy_desc", "test"), ("type", "L3"), ("ports", ",".join(bind_ports))])
ttbl.set("test", fvs)
time.sleep(2)
check_syslog(dvs, marker, "ACL_TABLE Exception occurred (div by Zero)", 1)

# create ACL rule
rtbl = swsscommon.Table(db, "ACL_RULE")
Expand Down

0 comments on commit 708e232

Please sign in to comment.