-
Notifications
You must be signed in to change notification settings - Fork 851
cisco platform-specific timeout update #16762
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
Open
nnelluri-cisco
wants to merge
8
commits into
sonic-net:master
Choose a base branch
from
nnelluri-cisco:reboot_timeout_fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bd3706c
cisco platform-specific timeout update
nnelluri-cisco bb3bc7e
added new changes to a function as per review comments
nnelluri-cisco 2360eeb
fixed type changes in newly added code
nnelluri-cisco a739e95
fixing the typo from REBO0T to REBOOT
nnelluri-cisco 28a055d
inconsistent use of tabs and spaces in indentation
nnelluri-cisco c088409
inconsistent use of tabs and spaces in indentation
nnelluri-cisco 016ca9e
Added a comment before timeouts and summary to the function
nnelluri-cisco 3e74111
fixed pre-commit errors
nnelluri-cisco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,10 @@ | |
REBOOT_TYPE_KERNEL_PANIC = "Kernel Panic" | ||
REBOOT_TYPE_SUPERVISOR = "Reboot from Supervisor" | ||
REBOOT_TYPE_SUPERVISOR_HEARTBEAT_LOSS = "Heartbeat with the Supervisor card lost" | ||
# Timeout waiting for smartswitch to come back after reboot | ||
SMARTSWITCH_REBOOT_TIMEOUT = 700 | ||
# Time to wait for smartswitch to stabilize | ||
SMARTSWITCH_REBOOT_WAIT = 300 | ||
|
||
# Event to signal DUT activeness | ||
DUT_ACTIVE = threading.Event() | ||
|
@@ -253,6 +257,8 @@ def reboot(duthost, localhost, reboot_type='cold', delay=10, | |
assert not (safe_reboot and return_after_reconnect) | ||
pool = ThreadPool() | ||
hostname = duthost.hostname | ||
# smartswitch specific reboot and wait time update | ||
smartswitch_update_reboot_timeout(duthost) | ||
try: | ||
tc_name = os.environ.get('PYTEST_CURRENT_TEST').split(' ')[0] | ||
plt_reboot_ctrl = get_plt_reboot_ctrl(duthost, tc_name, reboot_type) | ||
|
@@ -613,3 +619,18 @@ def collect_mgmt_config_by_console(duthost, localhost): | |
logger.info('End: collect mgmt config by console ...') | ||
else: | ||
logger.warning("dut console is not ready, we can get mgmt config by console") | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a summary to the function here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added summary to the function |
||
def smartswitch_update_reboot_timeout(duthost): | ||
""" | ||
@summary: This function updates the reboot timeout and wait time for a SmartSwitch device, | ||
based on the platform type | ||
@param duthost: DUT host object. | ||
""" | ||
# This is how you get platform info from the DUT | ||
platform = duthost.facts['platform'] | ||
# Apply the platform-specific timeout update | ||
if platform == 'x86_64-8102_28fh_dpu_o-r0': | ||
for reboot_type in reboot_ctrl_dict: | ||
reboot_ctrl_dict[reboot_type]["timeout"] = SMARTSWITCH_REBOOT_TIMEOUT | ||
reboot_ctrl_dict[reboot_type]["wait"] = SMARTSWITCH_REBOOT_WAIT |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment before these timeouts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added comment for the timeouts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might not be a satisfactory solution to modify a generic function to handle the timeout for smartswitch. Can we do that in a more generic way, like updating the
reboot_ctrl_dict
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had an offline sync with Bing. There are some concerns in making this platform-specific change in reboot function. @nnelluri-cisco, @rameshraghupathy Let's instead try to do this via plt_reboot_dict which is processed by reboot function using get_plt_reboot_ctrl().