diff --git a/tests/qos/test_tunnel_qos_remap.py b/tests/qos/test_tunnel_qos_remap.py index 388ccd941e0..5f255fbf016 100644 --- a/tests/qos/test_tunnel_qos_remap.py +++ b/tests/qos/test_tunnel_qos_remap.py @@ -27,7 +27,7 @@ dut_config, qos_config, tunnel_qos_maps, run_ptf_test, toggle_mux_to_host,\ setup_module, update_docker_services, swap_syncd, counter_poll_config # noqa F401 from .tunnel_qos_remap_base import leaf_fanout_peer_info, start_pfc_storm, \ - stop_pfc_storm, get_queue_counter, get_queue_watermark, disable_packet_aging # noqa F401 + stop_pfc_storm, get_queue_counter, get_queue_watermark # noqa F401 from ptf import testutils from ptf.testutils import simple_tcp_packet from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts # noqa F401 diff --git a/tests/qos/tunnel_qos_remap_base.py b/tests/qos/tunnel_qos_remap_base.py index ac45bdd99a7..97208bd1b23 100644 --- a/tests/qos/tunnel_qos_remap_base.py +++ b/tests/qos/tunnel_qos_remap_base.py @@ -310,30 +310,6 @@ def qos_config(rand_selected_dut, tbinfo, dut_config): return speed_cable_to_params[speed_cable] -@pytest.fixture(scope='module', autouse=True) -def disable_packet_aging(rand_selected_dut, duthosts): - """ - For Nvidia(Mellanox) platforms, packets in buffer will be aged after a timeout. Need to disable this - before any buffer tests. - """ - for duthost in duthosts: - asic = duthost.get_asic_name() - if 'spc' in asic: - logger.info("Disable Mellanox packet aging") - duthost.copy(src="qos/files/mellanox/packets_aging.py", dest="/tmp") - duthost.command("docker cp /tmp/packets_aging.py syncd:/") - duthost.command("docker exec syncd python /packets_aging.py disable") - - yield - - for duthost in duthosts: - asic = duthost.get_asic_name() - if 'spc' in asic: - logger.info("Enable Mellanox packet aging") - duthost.command("docker exec syncd python /packets_aging.py enable") - duthost.command("docker exec syncd rm -rf /packets_aging.py") - - def _create_ssh_tunnel_to_syncd_rpc(duthost): dut_asic = duthost.asic_instance() dut_asic.create_ssh_tunnel_sai_rpc() @@ -394,6 +370,13 @@ def update_docker_services(rand_selected_dut, swap_syncd, disable_container_auto for service in SERVICES: _update_docker_service(rand_selected_dut, action="stop", **service) + asic = rand_selected_dut.get_asic_name() + if 'spc' in asic: + logger.info("Disable Mellanox packet aging") + rand_selected_dut.copy(src="qos/files/mellanox/packets_aging.py", dest="/tmp") + rand_selected_dut.command("docker cp /tmp/packets_aging.py syncd:/") + rand_selected_dut.command("docker exec syncd python /packets_aging.py disable") + yield enable_container_autorestart( @@ -401,6 +384,11 @@ def update_docker_services(rand_selected_dut, swap_syncd, disable_container_auto for service in SERVICES: _update_docker_service(rand_selected_dut, action="start", **service) + if 'spc' in asic: + logger.info("Enable Mellanox packet aging") + rand_selected_dut.command("docker exec syncd python /packets_aging.py enable") + rand_selected_dut.command("docker exec syncd rm -rf /packets_aging.py") + def _update_mux_feature(duthost, state): cmd = "sudo config feature state mux {}".format(state)