diff --git a/tests/common/reboot.py b/tests/common/reboot.py index 23faf86890a..854840298fb 100644 --- a/tests/common/reboot.py +++ b/tests/common/reboot.py @@ -195,7 +195,7 @@ def execute_reboot_helper(): def reboot(duthost, localhost, reboot_type='cold', delay=10, timeout=0, wait=0, wait_for_ssh=True, wait_warmboot_finalizer=False, warmboot_finalizer_timeout=0, - reboot_helper=None, reboot_kwargs=None): + reboot_helper=None, reboot_kwargs=None, plt_reboot_ctrl_overwrite=True): """ reboots DUT :param duthost: DUT host object @@ -221,9 +221,10 @@ def reboot(duthost, localhost, reboot_type='cold', delay=10, timeout = reboot_ctrl['timeout'] if wait == 0: wait = reboot_ctrl['wait'] - if plt_reboot_ctrl: - wait = plt_reboot_ctrl['wait'] - timeout = plt_reboot_ctrl['timeout'] + if plt_reboot_ctrl_overwrite and plt_reboot_ctrl: + # get 'wait' and 'timeout' from inventory if they are specified, otherwise use current values + wait = plt_reboot_ctrl.get('wait', wait) + timeout = plt_reboot_ctrl.get('timeout', timeout) if warmboot_finalizer_timeout == 0 and 'warmboot_finalizer_timeout' in reboot_ctrl: warmboot_finalizer_timeout = reboot_ctrl['warmboot_finalizer_timeout'] except KeyError: diff --git a/tests/platform_tests/test_reload_config.py b/tests/platform_tests/test_reload_config.py index 4e499014c91..afb48188bca 100644 --- a/tests/platform_tests/test_reload_config.py +++ b/tests/platform_tests/test_reload_config.py @@ -23,11 +23,12 @@ ] -def test_reload_configuration(duthosts, rand_one_dut_hostname, conn_graph_facts, xcvr_skip_list): # noqa F811 +def test_reload_configuration(duthosts, enum_rand_one_per_hwsku_hostname, + conn_graph_facts, xcvr_skip_list): # noqa F811 """ @summary: This test case is to reload the configuration and check platform status """ - duthost = duthosts[rand_one_dut_hostname] + duthost = duthosts[enum_rand_one_per_hwsku_hostname] interfaces = conn_graph_facts["device_conn"][duthost.hostname] asic_type = duthost.facts["asic_type"] @@ -78,17 +79,18 @@ def check_database_status(duthost): return True -def test_reload_configuration_checks(duthosts, rand_one_dut_hostname, +def test_reload_configuration_checks(duthosts, enum_rand_one_per_hwsku_hostname, localhost, conn_graph_facts, xcvr_skip_list): # noqa F811 """ @summary: This test case is to test various system checks in config reload """ - duthost = duthosts[rand_one_dut_hostname] + duthost = duthosts[enum_rand_one_per_hwsku_hostname] if not config_force_option_supported(duthost): return - reboot(duthost, localhost, reboot_type="cold", wait=5) + reboot(duthost, localhost, reboot_type="cold", wait=5, + plt_reboot_ctrl_overwrite=False) # Check if all database containers have started wait_until(60, 1, 0, check_database_status, duthost) @@ -110,6 +112,10 @@ def test_reload_configuration_checks(duthosts, rand_one_dut_hostname, # Immediately after one config reload command, another shouldn't execute and wait for system checks logging.info("Checking config reload after system is up") + # Check if all database containers have started + wait_until(60, 1, 0, check_database_status, duthost) + # Check if interfaces-config.service is exited + wait_until(60, 1, 0, check_interfaces_config_service_status, duthost) out = duthost.shell("sudo config reload -y", executable="/bin/bash", module_ignore_errors=True) assert "Retry later" in out['stdout']