Read ACL counter of specific ACL table and ACL rule.
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')
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:
Returns an Integer
indicates the count of packets hit the specific ACL rule.
Example output:
1
AssertionError
- If argumenttimeout < 0
orinterval <= 0
.ValueError
- Ifaclshow -a
returns an invalid string on DUT.Exception
- Ifaclshow -a
still returnsN/A
aftertimeout
seconds.