Skip to content

Commit

Permalink
Fix bug with large amount of drop rules for each port on Arista 7250 (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
jongorel authored Apr 18, 2024
1 parent 3be5089 commit b06bdd0
Showing 1 changed file with 16 additions and 22 deletions.
38 changes: 16 additions & 22 deletions tests/generic_config_updater/test_dynamic_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,27 +962,22 @@ def dynamic_acl_apply_drop_scale_rules(duthost, setup):

priority = MAX_DROP_RULE_PRIORITY
json_patch = []
expected_rule_contents = {}
rule_number = 1

for port_name in setup["scale_port_names"]:
rule_name = "DROP_RULE_" + str(rule_number)
full_rule_name = "/ACL_RULE/DYNAMIC_ACL_TABLE|"+rule_name
rule_vals = {
"PRIORITY": str(priority),
"PACKET_ACTION": "DROP",
"IN_PORTS": port_name
}
patch = {
"op": "add",
"path": full_rule_name,
"value": rule_vals
}
json_patch.append(patch)
expected_content = ["DYNAMIC_ACL_TABLE", rule_name, str(priority), "DROP", "IN_PORTS: " + port_name, "Active"]
expected_rule_contents[rule_name] = expected_content
priority -= 1
rule_number += 1
rule_name = "DROP_RULE"
full_rule_name = "/ACL_RULE/DYNAMIC_ACL_TABLE|"+rule_name
all_ports = ",".join(setup["scale_port_names"])
rule_vals = {
"PRIORITY": str(priority),
"PACKET_ACTION": "DROP",
"IN_PORTS": all_ports
}
patch = {
"op": "add",
"path": full_rule_name,
"value": rule_vals
}
json_patch.append(patch)
expected_content = ["DYNAMIC_ACL_TABLE", rule_name, str(priority), "DROP", "IN_PORTS: " + all_ports, "Active"]

tmpfile = generate_tmpfile(duthost)
logger.info("tmpfile {}".format(tmpfile))
Expand All @@ -991,8 +986,7 @@ def dynamic_acl_apply_drop_scale_rules(duthost, setup):
output = apply_patch(duthost, json_data=json_patch, dest_file=tmpfile)
expect_op_success(duthost, output)

for rule_name, expected_content in expected_rule_contents.items():
expect_acl_rule_match(duthost, rule_name, expected_content)
expect_acl_rule_match(duthost, rule_name, expected_content)

finally:
delete_tmpfile(duthost, tmpfile)
Expand Down

0 comments on commit b06bdd0

Please sign in to comment.