Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/qos/test_tunnel_qos_remap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 12 additions & 24 deletions tests/qos/tunnel_qos_remap_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -394,13 +370,25 @@ 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(
rand_selected_dut, testcase="test_tunnel_qos_remap", feature_list=feature_list)
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)
Expand Down
Loading