Skip to content

Commit

Permalink
fix bad parameter for gCrmOrch->incCrmAclUsedCounter in qosorch (soni…
Browse files Browse the repository at this point in the history
…c-net#830)

* fix bad parameter for gCrmOrch->incCrmAclUsedCounter in qosorch

* fix VS test failure for test_crm.py::test_CrmAcl FAILED
  • Loading branch information
JaredLius authored and prsunny committed May 6, 2019
1 parent 9818b78 commit 5386d7f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion orchagent/qosorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ sai_object_id_t QosOrch::initSystemAclTable()
}
SWSS_LOG_NOTICE("Create a system ACL table for ECN coloring");

gCrmOrch->incCrmAclUsedCounter(CrmResourceType::CRM_ACL_TABLE, (sai_acl_stage_t) attr.value.s32, SAI_ACL_BIND_POINT_TYPE_PORT);
gCrmOrch->incCrmAclUsedCounter(CrmResourceType::CRM_ACL_TABLE, SAI_ACL_STAGE_INGRESS, SAI_ACL_BIND_POINT_TYPE_PORT);

for (auto& pair: gPortsOrch->getAllPorts())
{
Expand Down
10 changes: 7 additions & 3 deletions tests/test_crm.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,8 @@ def test_CrmAcl(dvs, testlog):

bind_ports = ["Ethernet0", "Ethernet4"]

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

# create ACL table
ttbl = swsscommon.Table(db, "ACL_TABLE")
fvs = swsscommon.FieldValuePairs([("policy_desc", "test"), ("type", "L3"), ("ports", ",".join(bind_ports))])
Expand All @@ -565,8 +567,9 @@ def test_CrmAcl(dvs, testlog):
rtbl.set("test|acl_test_rule", fvs)

time.sleep(2)

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

new_table_used_counter = getCrmCounterValue(dvs, 'ACL_STATS:INGRESS:PORT', 'crm_stats_acl_table_used')
table_used_counter = new_table_used_counter - old_table_used_counter
assert table_used_counter == 1

# get ACL table key
Expand Down Expand Up @@ -596,6 +599,7 @@ def test_CrmAcl(dvs, testlog):

time.sleep(2)

table_used_counter = getCrmCounterValue(dvs, 'ACL_STATS:INGRESS:PORT', 'crm_stats_acl_table_used')
new_table_used_counter = getCrmCounterValue(dvs, 'ACL_STATS:INGRESS:PORT', 'crm_stats_acl_table_used')
table_used_counter = new_table_used_counter - old_table_used_counter
assert table_used_counter == 0

0 comments on commit 5386d7f

Please sign in to comment.