From caeceb33ea428d65d4b47cbc8904198e2978a3db Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Fri, 6 Sep 2024 09:13:19 +0800 Subject: [PATCH] Fix reload_config failed on M0 device because PFCWD feature does not exist (#14138) Fix reload_config failed on M0 device because PFCWD feature does not exist #### Why I did it test case test_fallback_to_local_authorization_with_config_reload failed on M0 device when reload config. It's because PFCWD feature does not exist on M0. ### How I did it Ignore check when PFCWD feature not enable on device. #### How to verify it Pass all test case. ### Description for the changelog Fix reload_config failed on M0 device because PFCWD feature does not exist --- tests/common/config_reload.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/common/config_reload.py b/tests/common/config_reload.py index 7db56f9cdb..4634ea1598 100644 --- a/tests/common/config_reload.py +++ b/tests/common/config_reload.py @@ -105,6 +105,12 @@ def config_reload_minigraph_with_rendered_golden_config_override( override_config=True, golden_config_path=golden_config_path, is_dut=is_dut) +def pfcwd_feature_enabled(duthost): + device_metadata = duthost.config_facts(host=duthost.hostname, source="running")['ansible_facts']['DEVICE_METADATA'] + pfc_status = device_metadata['localhost']["default_pfcwd_status"] + return pfc_status == 'enable' + + @ignore_loganalyzer def config_reload(sonic_host, config_source='config_db', wait=120, start_bgp=True, start_dynamic_buffer=True, safe_reload=False, wait_before_force_reload=0, wait_for_bgp=False, @@ -195,7 +201,8 @@ def _config_reload_cmd_wrapper(cmd, executable): pytest_assert(wait_until(wait + 300, 20, 0, sonic_host.critical_services_fully_started), "All critical services should be fully started!") wait_critical_processes(sonic_host) - if config_source == 'minigraph': + # PFCWD feature does not enable on some topology, for example M0 + if config_source == 'minigraph' and pfcwd_feature_enabled(sonic_host): pytest_assert(wait_until(wait + 300, 20, 0, chk_for_pfc_wd, sonic_host), "PFC_WD is missing in CONFIG-DB")