diff --git a/tests/acl/test_stress_acl.py b/tests/acl/test_stress_acl.py index 47244a30bc4..ca0a80e5589 100644 --- a/tests/acl/test_stress_acl.py +++ b/tests/acl/test_stress_acl.py @@ -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: