Skip to content

Commit 0566e97

Browse files
committed
disable pfcwd before running qos_sai testing. (sonic-net#17393)
Description of PR Summary: After sonic-net/sonic-utilities#3792, we need to disable pfcwd on backplane ports. Approach What is the motivation for this PR? PFCWD needs to be disabled on backplane ports when running qos_sai testing How did you do it? added module level fixture to disable pfcwd co-authorized by: [email protected] (cherry picked from commit 69034ab)
1 parent 4ac4c09 commit 0566e97

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

tests/qos/qos_sai_base.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
from tests.common.errors import RunAnsibleModuleFail
3030
from tests.common import config_reload
3131
from tests.common.devices.eos import EosHost
32+
from tests.common.snappi_tests.qos_fixtures import get_pfcwd_config, reapply_pfcwd
33+
from tests.common.snappi_tests.common_helpers import \
34+
stop_pfcwd, disable_packet_aging, enable_packet_aging
3235

3336
logger = logging.getLogger(__name__)
3437

@@ -1934,6 +1937,26 @@ def dut_disable_ipv6(self, duthosts, tbinfo, lower_tor_host, swapSyncd_on_select
19341937
duthost, config_source='config_db', safe_reload=True, check_intf_up_ports=True,
19351938
)
19361939

1940+
@pytest.fixture(scope='module', autouse=True)
1941+
def dut_disable_pfcwd(self, duthosts):
1942+
switch_type = duthosts[0].facts.get('switch_type')
1943+
if switch_type != 'chassis-packet':
1944+
yield
1945+
return
1946+
1947+
# for packet chassis, the packet may go through backplane
1948+
# once tx is disabled on egress port, the continuous PFC PAUSE frame will trigger PFCWD on backplane ports
1949+
# to avoid the impact, we will disable it first before running the test
1950+
pfcwd_value = {}
1951+
for duthost in duthosts:
1952+
pfcwd_value[duthost.hostname] = get_pfcwd_config(duthost)
1953+
stop_pfcwd(duthost)
1954+
disable_packet_aging(duthost)
1955+
yield
1956+
for duthost in duthosts:
1957+
reapply_pfcwd(duthost, pfcwd_value[duthost.hostname])
1958+
enable_packet_aging(duthost)
1959+
19371960
@pytest.fixture(scope='class', autouse=True)
19381961
def sharedHeadroomPoolSize(
19391962
self, request, duthosts, get_src_dst_asic_and_duts, tbinfo, lower_tor_host): # noqa F811

0 commit comments

Comments
 (0)