getaclcounter
February 3, 2023 ยท View on GitHub
Overview
Read ACL counter of specific ACL table and ACL rule.
Examples
def test_fun(duthosts, rand_one_dut_hostname):
duthost = duthosts[rand_one_dut_hostname]
packets_count = duthost.get_acl_counter('YOUR_ACL_TABLE', 'YOUR_ACL_RULE')
Arguments
acl_table_name- name of ACL table- Required:
True - Type:
String
- Required:
acl_rule_name- name of ACL rule- Required:
True - Type:
String
- Required:
timeout- maximum time (in second) to wait until ACL counter available.- Required:
False - Type:
Integer - Default:
tests.common.devices.constants.ACL_COUNTERS_UPDATE_INTERVAL_IN_SEC * 2
- Required:
interval- retry interval (in second) between read ACL counter.- Required:
False - Type:
Integer - Default:
tests.common.devices.constants.ACL_COUNTERS_UPDATE_INTERVAL_IN_SEC
- Required:
Expected Output
Returns an Integer indicates the count of packets hit the specific ACL rule.
Example output:
1
Potential Exception
AssertionError- If argumenttimeout < 0orinterval <= 0.ValueError- Ifaclshow -areturns an invalid string on DUT.Exception- Ifaclshow -astill returnsN/Aaftertimeoutseconds.