-
Notifications
You must be signed in to change notification settings - Fork 189
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
Various minor enhancements for the 'console' command #1571
Open
sjg20
wants to merge
10
commits into
labgrid-project:master
Choose a base branch
from
sjg20:push4-cons
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.
Conversation
This file contains 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
It is common to acquire a place and then use it to access the console. Add a -a option to support this, to avoid running labgrid-client twice, which takes longer and makes error handling harder. If the place is acquired, it is released on exit. Signed-off-by: Simon Glass <sjg@chromium.org>
Some messages are printed regardless of the logging level. Convert them to logging statements so they can be suppressed. Signed-off-by: Simon Glass <sjg@chromium.org>
When a command fails in labgrid-client it just shows the return code. This makes it very hard to see what actually went wrong. Handle this exception explicitly, showing the output of the tool which failed. This allows easy debugging of the problem. This is particularly important with things like USB loaders. Signed-off-by: Simon Glass <sjg@chromium.org>
When a target may or may not be acquired, it is useful to be able to release it without checking first. Add an option for this, so that it is not necessary to check first. Signed-off-by: Simon Glass <sjg@chromium.org>
Use logging rather than print so that this output can be controlled. Signed-off-by: Simon Glass <sjg@chromium.org>
At present if a console device is used by a strategy driver it is then removed by the client immediately afterwards. If the 'console' command is used, this means that any console data is lost. This is done so that the console device is release for microcom, so move the logic in with the microcom logic. With the forthcoming internal terminal, it will not be needed. Signed-off-by: Simon Glass <sjg@chromium.org>
Put this code into a function to reduce the size of the _get_target() function. Signed-off-by: Simon Glass <sjg@chromium.org>
It is possible to set the initial state of a strategy, but not the final state. In many cases we want to power the board off and otherwise clean things up at the end. Provide a -e option to accomplish this. Signed-off-by: Simon Glass <sjg@chromium.org>
There is quite a lot of code here, so move the terminal function into its own file. This will make it easier to extend it later. Signed-off-by: Simon Glass <sjg@chromium.org>
At present Labgrid uses microcom as its console. This has some limitations: - console output is lost between when the board is reset and microcom connects - txdelay cannot be handled in microcom, meaning that boards may fail to receive expected output - the console may echo a few characters back to the caller in the time between when 'labgrid-client console' is executed and when microcom starts (which causes failures with U-Boot test system) For many use cases, microcom is more than is needed, so provide a simple internal terminal which resolved the above problems. It is enabled by a '-i' option to the 'console' command, as well as an environment variable, so that it can be adjustly without updating a lot of scripts. To exit, press Ctrl-] twice, quickly. Series-changes: 4 - Get internal console working with qemu - Show a prompt when starting, to indicate it is waiting for the board Signed-off-by: Simon Glass <sjg@chromium.org>
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.
Provides an internal console and a way to automatically select a final state
The internal console avoids the problem of losing output when labgrid closes the serial port and re-opens it in the switch from to microcom.
The final state can be used to ensure that the board is off after use, without needing to run labgrid-client again. It is similar to the initial state in that sense.
Together, this PR allows 'labgrid client' to function as a console device suitable for use with U-Boot's test.py, for example
See here for how this is used in a real lab:
https://ci.u-boot.org/u-boot/u-boot/-/jobs/19119
Checklist