Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvising pre_checks for test_reload config #7953

Merged
merged 6 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/common/reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ 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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change indention here?

Copy link
Contributor

@wenyiz2021 wenyiz2021 Jun 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not a feasible fix, it'll only overwrite timeout if wait == 0, however, the intention for having plt_reboot_ctrl is to give privilege for some TBs(chassis) to predefine a new timeout/wait that has more tolerance.

I just checked the wait is only used

time.sleep(wait)
, which is time for dut to be stabilize, and 5 sec is not enough for chassis. why do we want to keep it as 5?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

**the wait has kept for small duration intentionally to verifythe test -for reload configuration checks. The test is simulated to perform config reload before the dut is stablize and expect a check to the proper message.
***The plt_reboot_ctrl should only apply, if the (wait) time is not explicitly provided for a known objective

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @ansrajpu-git, please check my latest change, I have added a flag to control this, instead of overwriting both timeout and wait only if wait is 0.
please see if it works for you too?

wait = plt_reboot_ctrl['wait']
timeout = plt_reboot_ctrl['timeout']
if warmboot_finalizer_timeout == 0 and 'warmboot_finalizer_timeout' in reboot_ctrl:
warmboot_finalizer_timeout = reboot_ctrl['warmboot_finalizer_timeout']
except KeyError:
Expand Down
7 changes: 5 additions & 2 deletions tests/platform_tests/test_reload_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ 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")
out = duthost.shell("sudo config reload -y",
executable="/bin/bash", module_ignore_errors=True)
# 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)
wenyiz2021 marked this conversation as resolved.
Show resolved Hide resolved
assert "Retry later" in out['stdout']
assert wait_until(300, 20, 0, config_system_checks_passed, duthost)

Expand Down