Skip to content

Commit 708e232

Browse files
authored
Test divide by zero processing path (sonic-net#2028)
*Test divide by zero processing path. Add vs test coverage for sonic-net#1569 Signed-off-by: Wenda Ni <[email protected]>
1 parent 8f1d035 commit 708e232

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_crm.py

+16
Original file line numberDiff line numberDiff line change
@@ -625,10 +625,26 @@ def test_CrmAcl(self, dvs, testlog):
625625

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

628+
value = {
629+
"count": 1,
630+
"list": [
631+
{
632+
"stage": "SAI_ACL_STAGE_INGRESS",
633+
"bind_point": "SAI_ACL_BIND_POINT_TYPE_PORT",
634+
"avail_num": "4294967295"
635+
}
636+
]
637+
}
638+
dvs.setReadOnlyAttr('SAI_OBJECT_TYPE_SWITCH', 'SAI_SWITCH_ATTR_AVAILABLE_ACL_TABLE', json.dumps(value))
639+
time.sleep(2)
640+
641+
marker = dvs.add_log_marker()
628642
# create ACL table
629643
ttbl = swsscommon.Table(db, "ACL_TABLE")
630644
fvs = swsscommon.FieldValuePairs([("policy_desc", "test"), ("type", "L3"), ("ports", ",".join(bind_ports))])
631645
ttbl.set("test", fvs)
646+
time.sleep(2)
647+
check_syslog(dvs, marker, "ACL_TABLE Exception occurred (div by Zero)", 1)
632648

633649
# create ACL rule
634650
rtbl = swsscommon.Table(db, "ACL_RULE")

0 commit comments

Comments
 (0)