Skip to content

Commit

Permalink
Temporary fix for Dynamic ACL via GCU ACL rule replacement test (#12515)
Browse files Browse the repository at this point in the history
* Test to see if replace was the error
  • Loading branch information
jongorel authored and mssonicbld committed Apr 20, 2024
1 parent f94af93 commit 171044c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{
"op": "add",
"path": "/ACL_RULE/DYNAMIC_ACL_TABLE|RULE_1",
"value": {
"DST_IP": "{{ ipv4_subnet }}",
"PRIORITY": "9999",
"PACKET_ACTION": "FORWARD"
}
},
{
"op": "add",
"path": "/ACL_RULE/DYNAMIC_ACL_TABLE|RULE_2",
"value": {
"DST_IPV6": "{{ ipv6_subnet }}",
"PRIORITY": "9998",
"PACKET_ACTION": "FORWARD"
}
}
]
10 changes: 9 additions & 1 deletion tests/generic_config_updater/test_dynamic_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
CREATE_CUSTOM_TABLE_TYPE_FILE = "create_custom_table_type.json"
CREATE_CUSTOM_TABLE_TEMPLATE = "create_custom_table.j2"
CREATE_FORWARD_RULES_TEMPLATE = "create_forward_rules.j2"
CREATE_SECONDARY_FORWARD_RULES_TEMPLATE = "create_secondary_forward_rules.j2"
CREATE_INITIAL_DROP_RULE_TEMPLATE = "create_initial_drop_rule.j2"
CREATE_SECONDARY_DROP_RULE_TEMPLATE = "create_secondary_drop_rule.j2"
CREATE_THREE_DROP_RULES_TEMPLATE = "create_three_drop_rules.j2"
Expand Down Expand Up @@ -897,7 +898,14 @@ def dynamic_acl_replace_rules(duthost):
"DST_IPV6: " + REPLACEMENT_IPV6_SUBNET,
"Active"]

output = format_and_apply_template(duthost, REPLACE_RULES_TEMPLATE, extra_vars)
# replacing an ACL rule causing error logs to get flooded because of a SONiC bug currently - temporary fix

dynamic_acl_remove_ip_forward_rule(duthost, "IPV4")
dynamic_acl_remove_ip_forward_rule(duthost, "IPV6")

time.sleep(2)

output = format_and_apply_template(duthost, CREATE_SECONDARY_FORWARD_RULES_TEMPLATE, extra_vars)

expect_op_success(duthost, output)

Expand Down

0 comments on commit 171044c

Please sign in to comment.