From d71cd16b3fd325d7031e544c20fed0ae2c70ad23 Mon Sep 17 00:00:00 2001 From: Shweta Naik Date: Tue, 17 Jun 2025 15:56:18 -0700 Subject: [PATCH] Disabling voqWD in testcase where PFCWD is disabled and traffic is run for more than 1min. Added a method to check if dshell client is up and running --- tests/common/cisco_data.py | 9 +++++++++ tests/snappi_tests/cisco/helper.py | 5 ++++- tests/snappi_tests/pfcwd/test_pfcwd_actions.py | 7 ++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/common/cisco_data.py b/tests/common/cisco_data.py index f2bc56ea1aa..be07da99758 100644 --- a/tests/common/cisco_data.py +++ b/tests/common/cisco_data.py @@ -97,3 +97,12 @@ def set_voq_watchdog(enable): '''.format(enable) copy_dshell_script_cisco_8000(dut, asic, dshell_script, script_name="set_voq_watchdog.py") + + +def check_dshell_ready(duthost): + show_command = "sudo show platform npu rx cgm_global" + err_msg = "debug shell server for asic 0 is not running" + output = duthost.command(show_command)['stdout'] + if err_msg in output: + return False + return True diff --git a/tests/snappi_tests/cisco/helper.py b/tests/snappi_tests/cisco/helper.py index e723969230c..59b23ba00b1 100644 --- a/tests/snappi_tests/cisco/helper.py +++ b/tests/snappi_tests/cisco/helper.py @@ -1,5 +1,6 @@ # Helper functions to be used only for cisco platforms. -from tests.common.cisco_data import copy_set_voq_watchdog_script_cisco_8000 +from tests.common.utilities import wait_until +from tests.common.cisco_data import copy_set_voq_watchdog_script_cisco_8000, check_dshell_ready import pytest @@ -27,6 +28,8 @@ def modify_voq_watchdog_cisco_8000(duthost, enable): # copy_set_voq_watchdog_script_cisco_8000(duthost, "", enable=enable) ''' + if not wait_until(300, 20, 0, check_dshell_ready, duthost): + raise RuntimeError("Debug shell is not ready on {}".format(duthost.hostname)) for asic in asics: copy_set_voq_watchdog_script_cisco_8000(duthost, asic, enable=enable) duthost.shell(f"sudo show platform npu script -n asic{asic} -s set_voq_watchdog.py") diff --git a/tests/snappi_tests/pfcwd/test_pfcwd_actions.py b/tests/snappi_tests/pfcwd/test_pfcwd_actions.py index 85c84202c8e..3569ec205ad 100644 --- a/tests/snappi_tests/pfcwd/test_pfcwd_actions.py +++ b/tests/snappi_tests/pfcwd/test_pfcwd_actions.py @@ -15,7 +15,7 @@ from tests.common.config_reload import config_reload from tests.common.snappi_tests.snappi_test_params import SnappiTestParams from tests.snappi_tests.variables import MULTIDUT_PORT_INFO, MULTIDUT_TESTBED -from tests.snappi_tests.cisco.helper import disable_voq_watchdog # noqa: F401 +from tests.snappi_tests.cisco.helper import modify_voq_watchdog_cisco_8000 # noqa: F401 logger = logging.getLogger(__name__) @@ -1001,6 +1001,8 @@ def test_pfcwd_disable_pause_cngtn(snappi_api, # noqa: F811 for dut in duthosts: clear_fabric_counters(dut) + if dut.facts.get('asic_type') == "cisco-8000": + modify_voq_watchdog_cisco_8000(dut, False) try: run_pfc_test(api=snappi_api, @@ -1022,5 +1024,8 @@ def test_pfcwd_disable_pause_cngtn(snappi_api, # noqa: F811 finally: cleanup_config(duthosts, snappi_ports) + for dut in duthosts: + if dut.facts.get('asic_type') == "cisco-8000": + modify_voq_watchdog_cisco_8000(dut, True) for duthost in dut_list: config_reload(sonic_host=duthost, config_source='config_db', safe_reload=True)