Skip to content

Commit 8bb7203

Browse files
authored
[202411] Restore disable packet aging fixture 202411 (sonic-net#18103)
* Restore fixture disable_packet_aging
1 parent 8f6d1a3 commit 8bb7203

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

tests/qos/test_tunnel_qos_remap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
dut_config, qos_config, tunnel_qos_maps, run_ptf_test, toggle_mux_to_host,\
3030
setup_module, update_docker_services, swap_syncd, counter_poll_config # noqa F401
3131
from .tunnel_qos_remap_base import leaf_fanout_peer_info, start_pfc_storm, \
32-
stop_pfc_storm, get_queue_counter, get_queue_watermark # noqa F401
32+
stop_pfc_storm, get_queue_counter, get_queue_watermark, disable_packet_aging # noqa F401
3333
from ptf import testutils
3434
from ptf.testutils import simple_tcp_packet
3535
from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts # noqa F401

tests/qos/tunnel_qos_remap_base.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,32 @@ def qos_config(rand_selected_dut, tbinfo, dut_config):
316316
return speed_cable_to_params[speed_cable]
317317

318318

319+
@pytest.fixture(scope='module', autouse=True)
320+
def disable_packet_aging(duthosts):
321+
"""
322+
For Nvidia(Mellanox) platforms, packets in buffer will be aged after a timeout. Need to disable this
323+
before any buffer tests.
324+
"""
325+
for duthost in duthosts:
326+
asic = duthost.get_asic_name()
327+
if 'spc' in asic:
328+
logger.info("Disable Mellanox packet aging")
329+
duthost.copy(src="qos/files/mellanox/packets_aging.py", dest="/tmp")
330+
duthost.command("docker cp /tmp/packets_aging.py syncd:/")
331+
duthost.command("docker exec syncd python /packets_aging.py disable")
332+
333+
yield
334+
335+
for duthost in duthosts:
336+
asic = duthost.get_asic_name()
337+
if 'spc' in asic:
338+
# Ignore errors if the script is not found in syncd container as it may be removed
339+
# by swap_syncd
340+
logger.info("Enable Mellanox packet aging")
341+
duthost.command("docker exec syncd python /packets_aging.py enable", module_ignore_errors=True)
342+
duthost.command("docker exec syncd rm -rf /packets_aging.py", module_ignore_errors=True)
343+
344+
319345
def _create_ssh_tunnel_to_syncd_rpc(duthost):
320346
dut_asic = duthost.asic_instance()
321347
dut_asic.create_ssh_tunnel_sai_rpc()

0 commit comments

Comments
 (0)