Skip to content

Conversation

@jremmet
Copy link
Owner

@jremmet jremmet commented May 30, 2023

Description

Checklist

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • Add a section on how to use the feature to doc/usage.rst
  • Add a section on how to use the feature to doc/development.rst
  • PR has been tested
  • Man pages have been regenerated

@jremmet jremmet changed the base branch from master to origin/master May 30, 2023 13:07
@jremmet jremmet changed the base branch from origin/master to master May 30, 2023 13:07
@jremmet jremmet force-pushed the WIP/detect_boot branch from 2c330d7 to 04393a2 Compare May 30, 2023 13:17
@codecov-commenter
Copy link

codecov-commenter commented May 30, 2023

Codecov Report

Attention: Patch coverage is 55.18946% with 272 lines in your changes are missing coverage. Please review.

Project coverage is 53.2%. Comparing base (1318c27) to head (226b3eb).
Report is 255 commits behind head on master.

Files Patch % Lines
labgrid/driver/rawnetworkinterfacedriver.py 42.6% 51 Missing ⚠️
labgrid/driver/sigrokdriver.py 23.2% 43 Missing ⚠️
labgrid/driver/qemudriver.py 61.4% 27 Missing ⚠️
labgrid/resource/udev.py 6.8% 27 Missing ⚠️
labgrid/driver/sshdriver.py 59.2% 22 Missing ⚠️
labgrid/remote/client.py 5.2% 18 Missing ⚠️
labgrid/driver/power/eth008.py 27.2% 16 Missing ⚠️
labgrid/driver/powerdriver.py 5.8% 16 Missing ⚠️
labgrid/driver/power/poe_mib.py 29.4% 12 Missing ⚠️
labgrid/driver/bareboxdriver.py 65.2% 8 Missing ⚠️
... and 13 more

❗ 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.
📢 Have feedback on the report? Share it here.

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>
@jremmet jremmet force-pushed the WIP/detect_boot branch 3 times, most recently from 23c8e98 to 226b3eb Compare March 26, 2024 07:40
NickCao and others added 20 commits June 26, 2024 09:00
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
udisks2: Be more tolerant of device-startup time
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
jluebbe and others added 26 commits January 24, 2025 11:52
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
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
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
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.