Support recovering Nexus devices via console#11264
Merged
wangxin merged 6 commits intosonic-net:masterfrom Jan 18, 2024
Merged
Conversation
yejianquan
reviewed
Jan 17, 2024
| # enter_onie_flag += 1 | ||
| # continue | ||
|
|
||
| if "-OS-" in x and enter_onie_flag is True: |
Collaborator
There was a problem hiding this comment.
if "-OS-" in x and enter_onie_flag:
Contributor
Author
There was a problem hiding this comment.
I do some tests, and because of the rule of Python, we can use bool(enter_onie_flag) or use enter_onie_flag is True here. Simply enter_onie_flag will not be considered as a boolean.
| if "*ONIE" in x and "Install OS" not in x: | ||
| dut_console.remote_conn.send("\n") | ||
| enter_onie_flag += 1 | ||
| enter_onie_flag = False |
Collaborator
There was a problem hiding this comment.
Could you create constant for the strings like "-OS-", "*ONIE", "Install OS" and others, so that it would be clear to speculate the usage from the constant name
wangxin
reviewed
Jan 17, 2024
| # elif type in ["Cisco"]: | ||
| # return | ||
| elif type in ["mellanox", "nexus", "acs"]: | ||
| elif type in ["nexus"]: |
Collaborator
There was a problem hiding this comment.
Can you rename variable type to something like device_type? The reason is that it conflicts with python's builtin type.
| elif type in ["mellanox", "nexus", "acs"]: | ||
| elif type in ["nexus"]: | ||
| posix_shell_onie(dut_console, mgmt_ip, image_url, is_nexus=True) | ||
| elif type in ["mellanox", "cisco", "acs"]: |
Collaborator
There was a problem hiding this comment.
We also have some Nokia devices. Are they covered?
wangxin
approved these changes
Jan 17, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of PR
In PR #10806, we support auto recovery of testbeds via console. But at that time, we didn't support nexus testbeds.
In Nexus testbeds, they first enter into
loader, and after rebooting inloader, they enter intoONIE. So in this PR, we enhance the function which will do recover in ONIE to cover this sistuation.Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
In PR #10806, we support auto recovery of testbeds via console. But at that time, we didn't support nexus testbeds.
In Nexus testbeds, they first enter into
loader, and after rebooting inloader, they enter intoONIE. So in this PR, we enhance the function which will do recover in ONIE to cover this sistuation.How did you do it?
Enhance the function which will do recover in ONIE to cover Nexus testbeds. If the type of testbeds is Nexus, first do reboot, and then, recover in ONIE.
How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation