Skip to content

Commit

Permalink
Fix reload_config failed on M0 device because PFCWD feature does not …
Browse files Browse the repository at this point in the history
…exist (sonic-net#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
  • Loading branch information
liuh-80 authored and hdwhdw committed Sep 20, 2024
1 parent 15f8454 commit a9ecd75
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/common/config_reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit a9ecd75

Please sign in to comment.