Skip to content

Commit b347736

Browse files
AndoniSanguesaabhishek-nexthop
authored andcommitted
Fix Issue with Checking for Active ACL Rules by aclshow -a (sonic-net#21947)
* Feature/route programming data (sonic-net#21523) This PR adds test cases and supporting utilities to measure route programming time under high‑scale BGP IPv6 scenarios, building on the refactoring in PR sonic-net#21335. It focuses on quantifying how long it takes for routes to be fully programmed after BGP/connection events (e.g., convergence, admin flaps), and verifying that the measured RP times stay within expected limits and similar to the convergence time. Signed-off-by: Andoni Sanguesa <[email protected]> Signed-off-by: Abhishek <[email protected]>
1 parent 8959bc2 commit b347736

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

tests/everflow/everflow_test_utilities.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -976,22 +976,27 @@ def remove_outer_ip(self, packet_data):
976976

977977
return new_packet
978978

979-
def check_rule_counters(self, duthost):
979+
def check_rule_active(self, duthost, table_name):
980980
"""
981-
Check if Acl rule counters initialized
981+
Check if Acl rule initialized
982982
983983
Args:
984984
duthost: DUT host object
985985
Returns:
986986
Bool value
987987
"""
988-
res = duthost.shell("aclshow -a")['stdout_lines']
989-
if len(res) <= 2 or [line for line in res if 'N/A' in line]:
988+
res = duthost.shell(f"show acl rule {table_name}")['stdout_lines']
989+
if "Status" not in res[0]:
990990
return False
991-
else:
992-
return True
991+
status_index = res[0].index("Status")
992+
for line in res[2:]:
993+
if len(line) < status_index:
994+
continue
995+
if line[status_index:] != 'Active':
996+
return False
997+
return True
993998

994-
def apply_non_openconfig_acl_rle(self, duthost, extra_vars, rule_file):
999+
def apply_non_openconfig_acl_rule(self, duthost, extra_vars, rule_file, table_name):
9951000
"""
9961001
Not all ACL match groups are valid in openconfig-acl format used in rest of these
9971002
tests. Instead we must load these uing SONiC-style acl jsons.
@@ -1008,7 +1013,8 @@ def apply_non_openconfig_acl_rle(self, duthost, extra_vars, rule_file):
10081013
duthost.shell("config load -y {}".format(dest_path))
10091014

10101015
if duthost.facts['asic_type'] != 'vs':
1011-
pytest_assert(wait_until(60, 2, 0, self.check_rule_counters, duthost), "Acl rule counters are not ready")
1016+
pytest_assert(wait_until(60, 2, 0, self.check_rule_active, duthost, table_name),
1017+
"Acl rule counters are not ready")
10121018

10131019
def apply_ip_type_rule(self, duthost, ip_version):
10141020
"""
@@ -1031,7 +1037,7 @@ def apply_ip_type_rule(self, duthost, ip_version):
10311037
'table_name': table_name,
10321038
'action': action
10331039
}
1034-
self.apply_non_openconfig_acl_rle(duthost, extra_vars, rule_file)
1040+
self.apply_non_openconfig_acl_rule(duthost, extra_vars, rule_file, table_name)
10351041

10361042
def send_and_check_mirror_packets(self,
10371043
setup,

0 commit comments

Comments
 (0)