-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sub_port] [backend] Update acl template based on the test ports (#6556)
Signed-off-by: Neetha John <[email protected]> What is the motivation for this PR? For storage backend, new backend acl was added (sonic-net/sonic-utilities#2236). This caused regression for sub port testcases running on 't0-backend' topology. Modified the testcase to update the acl template based on the selected test ports How did you verify/test it? Ran the sub port testcases with the change and they passed
- Loading branch information
1 parent
edb029d
commit 0a08d14
Showing
3 changed files
with
122 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
tests/sub_port_interfaces/templates/backend_acl_update_config.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{%- set vlan2ports = {} %} | ||
{%- for vlan in VLAN %} | ||
{% set portlist = [] %} | ||
{%- for vlan_name, port in VLAN_MEMBER %} | ||
{%- if vlan_name == vlan %} | ||
{%- if portlist.append(port) %}{%- endif %} | ||
{%- endif %} | ||
{%- endfor %} | ||
{%- set _ = vlan2ports.update({vlan: portlist| sort | join(',')}) %} | ||
{%- endfor %} | ||
|
||
|
||
{ | ||
"acl": { | ||
"acl-sets": { | ||
"acl-set": { | ||
"DATAACL": { | ||
"acl-entries": { | ||
"acl-entry": { | ||
{% for vlan, vlan_entries in VLAN.items() %} | ||
"{{ loop.index }}": { | ||
"config": { | ||
"sequence-id": {{ loop.index }} | ||
}, | ||
"actions": { | ||
"config": { | ||
"forwarding-action": "ACCEPT" | ||
} | ||
}, | ||
"l2": { | ||
"config": { | ||
"vlan_id": "{{ vlan_entries['vlanid'] }}" | ||
} | ||
}, | ||
"input_interface": { | ||
"interface_ref": { | ||
"config": { | ||
"interface": "{{ vlan2ports[vlan] }}" | ||
} | ||
} | ||
} | ||
|
||
}, | ||
{% endfor -%} | ||
"999": { | ||
"config": { | ||
"sequence-id": 999 | ||
}, | ||
"actions": { | ||
"config": { | ||
"forwarding-action": "ACCEPT" | ||
} | ||
}, | ||
"input_interface": { | ||
"interface_ref": { | ||
"config": { | ||
"interface": "{{ intf_list }}" | ||
} | ||
} | ||
} | ||
} | ||
|
||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |