From 33478ba57f228961d2e3d0c8f60eaad43995725f Mon Sep 17 00:00:00 2001 From: zitingguo Date: Tue, 2 Jun 2026 12:49:16 +0800 Subject: [PATCH] [BMC] Skip swss readiness gate in config_system_checks_passed on BMC BMC devices (DEVICE_METADATA.localhost.type == 'NetworkBmc') have no front-side ASIC. swss/syncd are intentionally not running on BMC, so the existing readiness gate in config_system_checks_passed() - which waits for 'systemctl show swss.service --property ActiveState' == 'active' - never passes. Every reload-using test (e.g. platform_tests/test_reload_config.py::test_reload_configuration[_checks]) times out after 360s with: AssertionError: System checks did not pass within the allotted time after config reload. Use the cached SonicHost.is_bmc() helper (same pattern as tests/bmc/conftest.py, cacl/test_cacl_function.py, process_monitoring/test_critical_process_monitoring.py) to short-circuit the swss check on BMC. No shell call, no new dependency, behavior unchanged on every non-BMC device. Tracking: PBI 37906237. Signed-off-by: zitingguo --- tests/common/config_reload.py | 36 +++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/tests/common/config_reload.py b/tests/common/config_reload.py index 66da3036f7b..9398084783b 100644 --- a/tests/common/config_reload.py +++ b/tests/common/config_reload.py @@ -35,26 +35,34 @@ def config_system_checks_passed(duthost, delayed_services=[]): logging.info(fail_reason['stdout_lines']) return False - logging.info("Checking if Orchagent up for at least 2 min") - if duthost.is_multi_asic: - for asic in duthost.asics: - out = duthost.shell("systemctl show swss@{}.service --property ActiveState --value".format(asic.asic_index)) + if duthost.is_bmc(): + # BMC devices (DEVICE_METADATA.localhost.type == 'NetworkBmc') have no + # front-side ASIC. swss/syncd are intentionally not running, so the + # swss readiness gate below would never pass on BMC. + logging.info("Skipping swss readiness gate on BMC device") + else: + logging.info("Checking if Orchagent up for at least 2 min") + if duthost.is_multi_asic: + for asic in duthost.asics: + out = duthost.shell( + "systemctl show swss@{}.service --property ActiveState --value".format(asic.asic_index)) + if out["stdout"] != "active": + return False + + cmd = ("ps -o etimes -p $(systemctl show swss@{}.service --property ExecMainPID --value)" + " | sed '1d'").format(asic.asic_index) + out = duthost.shell(cmd) + if int(out['stdout'].strip()) < 120: + return False + else: + out = duthost.shell("systemctl show swss.service --property ActiveState --value") if out["stdout"] != "active": return False out = duthost.shell( - "ps -o etimes -p $(systemctl show swss@{}.service --property ExecMainPID --value) | sed '1d'".format( - asic.asic_index)) + "ps -o etimes -p $(systemctl show swss.service --property ExecMainPID --value) | sed '1d'") if int(out['stdout'].strip()) < 120: return False - else: - out = duthost.shell("systemctl show swss.service --property ActiveState --value") - if out["stdout"] != "active": - return False - - out = duthost.shell("ps -o etimes -p $(systemctl show swss.service --property ExecMainPID --value) | sed '1d'") - if int(out['stdout'].strip()) < 120: - return False logging.info("Checking delayed services: %s", delayed_services) for service in delayed_services: