diff --git a/tests/qos/qos_sai_base.py b/tests/qos/qos_sai_base.py index 7815838a922..9a53423a27d 100644 --- a/tests/qos/qos_sai_base.py +++ b/tests/qos/qos_sai_base.py @@ -29,6 +29,9 @@ from tests.common.errors import RunAnsibleModuleFail from tests.common import config_reload from tests.common.devices.eos import EosHost +from tests.common.snappi_tests.qos_fixtures import get_pfcwd_config, reapply_pfcwd +from tests.common.snappi_tests.common_helpers import \ + stop_pfcwd, disable_packet_aging, enable_packet_aging logger = logging.getLogger(__name__) @@ -1934,6 +1937,26 @@ def dut_disable_ipv6(self, duthosts, tbinfo, lower_tor_host, swapSyncd_on_select duthost, config_source='config_db', safe_reload=True, check_intf_up_ports=True, ) + @pytest.fixture(scope='module', autouse=True) + def dut_disable_pfcwd(self, duthosts): + switch_type = duthosts[0].facts.get('switch_type') + if switch_type != 'chassis-packet': + yield + return + + # for packet chassis, the packet may go through backplane + # once tx is disabled on egress port, the continuous PFC PAUSE frame will trigger PFCWD on backplane ports + # to avoid the impact, we will disable it first before running the test + pfcwd_value = {} + for duthost in duthosts: + pfcwd_value[duthost.hostname] = get_pfcwd_config(duthost) + stop_pfcwd(duthost) + disable_packet_aging(duthost) + yield + for duthost in duthosts: + reapply_pfcwd(duthost, pfcwd_value[duthost.hostname]) + enable_packet_aging(duthost) + @pytest.fixture(scope='class', autouse=True) def sharedHeadroomPoolSize( self, request, duthosts, get_src_dst_asic_and_duts, tbinfo, lower_tor_host): # noqa F811