diff --git a/tests/qos/test_tunnel_qos_remap.py b/tests/qos/test_tunnel_qos_remap.py index 562d38454d7..9aa9d45a757 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 # noqa F401 + stop_pfc_storm, get_queue_counter, get_queue_watermark, disable_packet_aging # 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 97208bd1b23..ea9ce1569fd 100644 --- a/tests/qos/tunnel_qos_remap_base.py +++ b/tests/qos/tunnel_qos_remap_base.py @@ -310,6 +310,30 @@ 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(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()