diff --git a/tests/acl/test_acl.py b/tests/acl/test_acl.py index 3b33bed4ca9..9eb2420e845 100644 --- a/tests/acl/test_acl.py +++ b/tests/acl/test_acl.py @@ -22,6 +22,9 @@ from tests.common.dualtor.dual_tor_mock import mock_server_base_ip_addr # noqa F401 from tests.common.helpers.constants import DEFAULT_NAMESPACE from tests.common.utilities import get_upstream_neigh_type, get_downstream_neigh_type +from tests.common.fixtures.conn_graph_facts import conn_graph_facts # noqa F401 +from tests.common.platform.processes_utils import wait_critical_processes +from tests.common.platform.interface_utils import check_all_interface_information logger = logging.getLogger(__name__) @@ -31,6 +34,8 @@ pytest.mark.topology("t0", "t1", "t2", "m0", "mx"), ] +MAX_WAIT_TIME_FOR_INTERFACES = 360 + BASE_DIR = os.path.dirname(os.path.realpath(__file__)) DUT_TMP_DIR = "acl_test_dir" # Keep it under home dir so it persists through reboot FILES_DIR = os.path.join(BASE_DIR, "files") @@ -578,7 +583,7 @@ def setup_rules(self, dut, acl_table, ip_version): """ pass - def post_setup_hook(self, dut, localhost, populate_vlan_arp_entries, tbinfo): + def post_setup_hook(self, dut, localhost, populate_vlan_arp_entries, tbinfo, conn_graph_facts): # noqa F811 """Perform actions after rules have been applied. Args: @@ -607,7 +612,8 @@ def teardown_rules(self, dut): dut.command("config acl update full {}".format(remove_rules_dut_path)) @pytest.fixture(scope="class", autouse=True) - def acl_rules(self, duthosts, localhost, setup, acl_table, populate_vlan_arp_entries, tbinfo, ip_version): + def acl_rules(self, duthosts, localhost, setup, acl_table, populate_vlan_arp_entries, tbinfo, + ip_version, conn_graph_facts): # noqa F811 """Setup/teardown ACL rules for the current set of tests. Args: @@ -634,7 +640,7 @@ def acl_rules(self, duthosts, localhost, setup, acl_table, populate_vlan_arp_ent with loganalyzer: self.setup_rules(duthost, acl_table, ip_version) - self.post_setup_hook(duthost, localhost, populate_vlan_arp_entries, tbinfo) + self.post_setup_hook(duthost, localhost, populate_vlan_arp_entries, tbinfo, conn_graph_facts) assert self.check_rule_counters(duthost), "Rule counters should be ready!" @@ -1170,7 +1176,7 @@ class TestAclWithReboot(TestBasicAcl): upon startup. """ - def post_setup_hook(self, dut, localhost, populate_vlan_arp_entries, tbinfo): + def post_setup_hook(self, dut, localhost, populate_vlan_arp_entries, tbinfo, conn_graph_facts): # noqa F811 """Save configuration and reboot after rules are applied. Args: @@ -1184,6 +1190,19 @@ def post_setup_hook(self, dut, localhost, populate_vlan_arp_entries, tbinfo): # We need some additional delay on e1031 if dut.facts["platform"] == "x86_64-cel_e1031-r0": time.sleep(240) + + # We need additional delay and make sure ports are up for Nokia-IXR7250E-36x400G + if dut.facts["hwsku"] == "Nokia-IXR7250E-36x400G": + interfaces = conn_graph_facts["device_conn"][dut.hostname] + logging.info("Wait until all critical services are fully started") + wait_critical_processes(dut) + + xcvr_skip_list = {dut.hostname: []} + result = wait_until(MAX_WAIT_TIME_FOR_INTERFACES, 20, 0, check_all_interface_information, dut, interfaces, + xcvr_skip_list) + assert result, "Not all transceivers are detected or interfaces are up in {} seconds".format( + MAX_WAIT_TIME_FOR_INTERFACES) + populate_vlan_arp_entries() @@ -1194,7 +1213,7 @@ class TestAclWithPortToggle(TestBasicAcl): Verify that ACLs still function as expected after links flap. """ - def post_setup_hook(self, dut, localhost, populate_vlan_arp_entries, tbinfo): + def post_setup_hook(self, dut, localhost, populate_vlan_arp_entries, tbinfo, conn_graph_facts): # noqa F811 """Toggle ports after rules are applied. Args: