Skip to content

Commit 48d7fe7

Browse files
authored
ACL test fix for 8111 (#8739)
* ACL test fix for 8111 * Added more HWSKU * Indentation fixed * Indentation * Indentation
1 parent ca527ec commit 48d7fe7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/acl/test_acl.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ def counters_sanity_check(self, duthosts, acl_rules, acl_table):
684684
"""
685685
acl_facts = defaultdict(dict)
686686
table_name = acl_table["table_name"]
687+
skip_byte_accounting = False
687688
for duthost in duthosts:
688689
if duthost.is_supervisor_node():
689690
continue
@@ -734,12 +735,20 @@ def counters_sanity_check(self, duthosts, acl_rules, acl_table):
734735
continue
735736
counters_after[PACKETS_COUNT] += acl_facts[duthost]['after'][rule][PACKETS_COUNT]
736737
counters_after[BYTES_COUNT] += acl_facts[duthost]['after'][rule][BYTES_COUNT]
738+
if (duthost.facts["hwsku"] == "Cisco-8111-O64" or
739+
duthost.facts["hwsku"] == "Cisco-8111-O32" or
740+
duthost.facts["hwsku"] == "Cisco-8111-C32" or
741+
duthost.facts["hwsku"] == "Cisco-8111-O62C2"):
742+
skip_byte_accounting = True
737743

738744
logger.info("Counters for ACL rule \"{}\" after traffic:\n{}"
739745
.format(rule, pprint.pformat(counters_after)))
740746

741747
assert counters_after[PACKETS_COUNT] > counters_before[PACKETS_COUNT]
742-
assert counters_after[BYTES_COUNT] > counters_before[BYTES_COUNT]
748+
if not skip_byte_accounting:
749+
assert counters_after[BYTES_COUNT] > counters_before[BYTES_COUNT]
750+
else:
751+
logger.info("No byte counters for this hwsku\n")
743752

744753
@pytest.fixture(params=["downlink->uplink", "uplink->downlink"])
745754
def direction(self, request):

0 commit comments

Comments
 (0)