Skip to content

Commit

Permalink
Fix acl/test_stress_acl.py invalid interface name (#15796)
Browse files Browse the repository at this point in the history
Description of PR
Fix acl/test_stress_acl.py using bad interface name for ACL table creation

Summary:
Fixes # (issue)
In acl/test_stress_acl.py, it attempts to retrieve an interface that can be used to create a ACL table. DUTs with and without PortChannels require different methods respectively.

Currently, it checks by filtering with topo. However, some topology flags can have configurations that have or not have PortChannels, making topos no longer a sufficient check - in some topos the test will fail with:

Error: Failed to parse ACL table config: exception=Cannot bind ACL to specified port Ethernet136
Reproducible by manually running the following on the DUT:

config acl add table DATAACL L3 -s ingress -p Ethernet0
^FAILS
config acl add table DATAACL L3 -s ingress -p PortChannel101
^WORKS
  • Loading branch information
justin-wong-ce authored and mssonicbld committed Dec 19, 2024
1 parent e47c1fd commit 1e935d9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/acl/test_stress_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,15 @@ def prepare_test_file(rand_selected_dut):
@pytest.fixture(scope='module')
def prepare_test_port(rand_selected_dut, tbinfo):
mg_facts = rand_selected_dut.get_extended_minigraph_facts(tbinfo)
if tbinfo["topo"]["type"] == "mx":
dut_port = mg_facts["minigraph_acls"]["DataAcl"][0]
else:
dut_port = list(mg_facts['minigraph_portchannels'].keys())[0]

ports = list(mg_facts['minigraph_portchannels'])
if not ports:
ports = mg_facts["minigraph_acls"]["DataAcl"]

dut_port = ports[0] if ports else None

if not dut_port:
pytest.skip('No portchannels found')
pytest.skip('No portchannels nor dataacl ports found')
if "Ethernet" in dut_port:
dut_eth_port = dut_port
elif "PortChannel" in dut_port:
Expand Down

0 comments on commit 1e935d9

Please sign in to comment.