forked from labgrid-project/labgrid
-
Notifications
You must be signed in to change notification settings - Fork 0
Wip/detect boot #2
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
jremmet
wants to merge
574
commits into
master
Choose a base branch
from
WIP/detect_boot
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
Conversation
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
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #2 +/- ##
=========================================
- Coverage 63.2% 53.2% -10.0%
=========================================
Files 152 163 +11
Lines 11330 12037 +707
=========================================
- Hits 7169 6414 -755
- Misses 4161 5623 +1462 ☔ View full report in Codecov by Sentry. |
04393a2 to
efb5f35
Compare
jremmet
pushed a commit
that referenced
this pull request
Aug 21, 2023
The docker docs contain [1] these COPY forms: COPY [--chown=<user>:<group>] [--chmod=<perms>] <src>... <dest> COPY [--chown=<user>:<group>] [--chmod=<perms>] ["<src>",... "<dest>"] Arguments within [ ] are optional. The square brackets are not meant to be part of the actual instruction. The docker docs [1] mention that "[e]ach <src> may contain wildcards and matching will be done using Go’s filepath.Match rules". Go’s filepath.Match [2] interprets terms in square brackets as a character class. "[--chown=root:root]" must have been interpreted as a valid character class until recently. A couple of days ago, building the "dut" service started failing: Building dut #0 building with "default" instance using docker driver #1 [internal] load build definition from Dockerfile #1 transferring dockerfile: 924B done #1 DONE 0.0s #2 [internal] load .dockerignore #2 transferring context: 2B done #2 DONE 0.0s labgrid-project#3 [internal] load metadata for docker.io/library/debian:bookworm-slim labgrid-project#3 DONE 0.1s labgrid-project#4 [1/4] FROM docker.io/library/debian:bookworm-slim@sha256:89468107e4c2b9fdea2f15fc582bf92c25aa4296a661ca0202f7ea2f4fc3f48c labgrid-project#4 CACHED labgrid-project#5 [internal] load build context labgrid-project#5 transferring context: 56B done labgrid-project#5 ERROR: error from sender: invalid includepatterns: []: syntax error in pattern Fix this by dropping the accidental square brackets around the --chown option. [1] https://docs.docker.com/engine/reference/builder/#copy [2] https://pkg.go.dev/path/filepath#Match Signed-off-by: Bastian Krause <bst@pengutronix.de>
23c8e98 to
226b3eb
Compare
microcom is generally not available on rpm based distributions[1], making it hard to setup labgrid client on them. [1] https://repology.org/project/microcom/versions Signed-off-by: Nick Cao <nickcao@nichi.co> [r.czerwinski@pengutronix.de: rebased, added CHANGES.rst entry] Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
remote/client: fallback to telnet when microcom is not available
console: Make settle() indicate success/failure
driver/sigrok: various fixes
udisks2: Be more tolerant of device-startup time
doc/development: document await_resources
If self.signal is "dtr", a ValueError is raised. That happens because the if/else logic is wrong for that case. Fix that. Signed-off-by: Bastian Krause <bst@pengutronix.de>
…used SSHConnection does not open a new connection if an existing connection is open. It reuses the connection and starts a keepalive command (cat). On disconnect(), the keepalive command is only stopped for newly initiated connections, not for existing ones. Fix that by stopping the keepalive first, unconditionally. Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
…utputDriver example Signed-off-by: Bastian Krause <bst@pengutronix.de>
Driver and image are not expected on the same indentation level. Other drivers use an example with two sections, one for the driver and one for global options like "images". Do the same for the DediprogFlashDriver to prevent confusion. Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
No need to ensure a maximum number - new models can have more outlets. Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
…ldigitaloutput driver/serialdigitaloutput: fix get() for DTR signal
…ssh-keepalive util/ssh: stop keepalive in disconnect() when existing connection is used
…o-max-outlets driver/power: Remove check for maximum number of outlets for raritan
The ExternalConsoleDriver works on top of a command executed on the local computer. Until now the system default of io.DEFAULT_BUFFER_SIZE (typically 8192 bytes) was used for bufsize. This does not work well for this use case, we want unbuffered reads and writes. So set the bufsize to 0, see https://docs.python.org/3/library/subprocess.html#popen-constructor . Signed-off-by: Bastian Krause <bst@pengutronix.de>
…nalconsole-bufsize driver/externalconsoledriver: use bufsize=0 for opening external process
As the state is saved in a separate thread, longer times are not as problematic, so move them to debug log level. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
improve handing of background tasks in the coordinator
remote/exporter: poll resource on add
The date does not reflect the latest update, but rather the initial version of the man page. It creates the impression that the man page is outdated, although it's not. Let's drop the date altogether. Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
labgrid uses calver (calendar versioning) with a "YY.MINOR[.MICRO]" format string. So the next release will happen this year. Signed-off-by: Bastian Krause <bst@pengutronix.de>
…ight-2025 Extend copyright period to 2025
fix the tag value validation error: labgrid-client -p my_place create labgrid-client -p my_place set-tags my_tag=15 labgrid-client reserve my_tag=15 #error this error happens when the value starts with a number. Signed-off-by: Idan Saadon <idan.saadon@arm.com>
…e-validation remote: tag value validation in labgrid-client
Check if a place acquire request tries to lock a resource that is marked as orphaned. This means we no longer need to reacquire orphaned resource before trying to acquire a places resources since we now refuse to acquire the resources. This avoids long delays on aquire calls if the exporter responsible for an (unrelated) orphaned resource doesn't process commands quickly. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Labgrid currently uses bidirectional streams between coordinator and client/exporter. For the client side this is a good fit, since the client sends requests and the coordinator can answer directly. However for the exporter we have a case where nested calls were used in the old crossbar infrastructure, namely when re-acquiring a resource after the exporter was offline but the place was kept acquired. We call these orphaned resources. They replace the real resource on the coordinator side until the resource can be reacquired on the respective exporter after it has restarted. With crossbar, when seeing the resource update, the coordinator could directly call the exporter to acquire the resource for the specific place. This was possible since crossbar did the RPC route handling and arbitrary services connected to the crossbar could provide RPC calls to the service. With GRPC, we are more constrained. Since we only have a single Input/Output stream which needs to multiplex different objects, nested calls are not directly supported, since the exporter side would still wait for the coordinator to answer its own request. A different approach to orphaned resource handling is required. The coordinator now uses a loop where it checks the orphaned resources and tries to reacquire them if the exporter reappears. This however introduces another problem, the exporter can be under high load and thus the acquire request from the coordinator can time out. In this case, we need to abort the acquisition during a regular lock and in case of an orphaned resource need to replace the orphaned resource with the eventually acquired resource from the exporter. We also need to handle the case where the exporter has an acquired resource, but the place has been released in the meantime (perhaps due to a timeout on a normal place acquire), the same poll loop handles this in the coordinator as well. All in all this means that the resource acquired state for each place is not necessarily consistent on the coordinator, but will reach an eventual consistent state. This should be sufficient, since exporter restarts with orphaned resources should be relatively rare. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
…d-resources refactor handling of orphaned resources in the coordinator
This makes it more clear what state we're waiting for. Signed-off-by: Bastian Krause <bst@pengutronix.de>
`docker <subcommand> --help` cannot be used to detect whether a sub command is available because it exits with 0 no matter if the sub command exists or not. Use `docker buildx version` as a test for buildx support instead. Fixes: 17765c7 ("dockerfiles: support for docker/podman buildx") Reported-by: Sebastian Groß <sebastian.gross@emlix.com> Signed-off-by: Bastian Krause <bst@pengutronix.de>
…rkiface-wait-state-expected driver/networkinterfacedriver: add wait_state()'s expected argument to step
Add a hint for the labgrid-client allow command in lock error messages. Given the error message suggests that removing the lock is necessary (using unlock or kick), add a hint that there is also third choice. Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>
…r-buildx-fix dockerfiles/build.sh: fix buildx detection
labgrid/resource/remote: add missing sigrok channel_group parameter
remote/client: add hint for the labgrid-client allow command
…tools driver/sshdriver: read from tools
This is a workround for the gRPC issue grpc/grpc#38679. Since Python 3.12, an empty exception message is printed from gRPC during shutdown, although nothing seems to go wrong. As this is confusing for users, suppress the message by closing stderr. When in debug mode, we keep it open. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
…ror-message remote/client: suppress gRPC error message on shutdown
The work around introduced with [1] makes labgrid-client exit with exit code 120. This happens due to sys.stderr being closed prematurely and Py_FinalizeEx() thus failing to flush stderr [2]. Instead of closing stderr, add a sys.excepthook indirection which also prevents the empty excepthook error from being displayed and should also allow actual errors to be displayed [3]. That means we can add it unconditionally. [1] 2dc889c ("remote/client: suppress gRPC error message on shutdown") [2] https://hg.python.org/cpython/rev/6b08429a3932 [3] grpc/grpc#36655 (comment) Fixes: 2dc889c ("remote/client: suppress gRPC error message on shutdown") Signed-off-by: Bastian Krause <bst@pengutronix.de>
…thook remote: client: fix empty sys.excepthook error work around
226b3eb to
670e0ca
Compare
Sets self.boot_detected in _await_prompt. This is used in reset to check if a reboot has occurred. Can also be used in strategies. Signed-off-by: Jan Remmet <j.remmet@phytec.de>
Sets self.boot_detected in _await_prompt. This is used in reset to check if a reboot has occurred. Can also be used in strategies. Direct checking was deprecated with: 7b55a19 ("driver/ubootdriver: deprecate boot_expression attribute") Signed-off-by: Jan Remmet <j.remmet@phytec.de>
670e0ca to
4b9a7a2
Compare
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
Checklist