Skip to content

Conversation

@jluebbe
Copy link
Member

@jluebbe jluebbe commented Sep 23, 2021

Description
This adds support to export the low-level information used by the drivers to
external programs. To use this, you need to run labgrid-client with an
environment configuration (-c):

   $ labgrid-client -c foo.yaml export -
   Selected role main and place foo from configuration file
   export LG__CLIENT_PID=373996
   export LG__CONSOLE_HOST=rlaba-srv
   export LG__CONSOLE_PORT=52855
   export LG__CONSOLE_PROTOCOL=rfc2217
   export LG__CONSOLE_SPEED=115200
   export LG__ETH_HOST=raspberrypi
   export LG__ETH_IFNAME=''
   export LG__TFTP_EXTERNAL=foo/
   export LG__TFTP_HOST=raspberrypi
   export LG__TFTP_INTERNAL=/srv/tftp/foo/
   export LG__WIFI_HOST=raspberrypi
   export LG__WIFI_IFNAME=wlp1s0u1u3
   Waiting for CTRL+C or SIGTERM...

Writing to a file is supported as well:

   $ labgrid-client -c foo.yaml export test.env
   Selected role main and place foo from configuration file
   Exported to test.env
   Waiting for CTRL+C or SIGTERM...

When using this from a script, you will need to poll until the file is created
and the source the shell variables from it. The script can later stop
labgrid-client by sending using kill $LG__CLIENT_PID.

Checklist

  • Documentation for the feature
  • Tests for the feature
  • CHANGES.rst has been updated
  • PR has been tested
  • Man pages have been regenerated

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
This is useful to ensure the proper binding state for functions that can't be
called while the driver is active, which is useful for the upcoming export
functionality.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
This will allow using labgrid resources from other programs.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
This adds support to export the low-level information used by the drivers to
external programs. To use this, you need to run labgrid-client with an
environment configuration (-c):

   $ labgrid-client -c foo.yaml export -
   Selected role main and place foo from configuration file
   export LG__CLIENT_PID=373996
   export LG__CONSOLE_HOST=rlaba-srv
   export LG__CONSOLE_PORT=52855
   export LG__CONSOLE_PROTOCOL=rfc2217
   export LG__CONSOLE_SPEED=115200
   export LG__ETH_HOST=raspberrypi
   export LG__ETH_IFNAME=''
   export LG__TFTP_EXTERNAL=foo/
   export LG__TFTP_HOST=raspberrypi
   export LG__TFTP_INTERNAL=/srv/tftp/foo/
   export LG__WIFI_HOST=raspberrypi
   export LG__WIFI_IFNAME=wlp1s0u1u3
   Waiting for CTRL+C or SIGTERM...

Writing to a file is supported as well:

   $ labgrid-client -c foo.yaml export test.env
   Selected role main and place foo from configuration file
   Exported to test.env
   Waiting for CTRL+C or SIGTERM...

When using this from a script, you will need to poll until the file is created
and the source the shell variables from it. The script can later stop
labgrid-client by sending using kill $LG__CLIENT_PID.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
@codecov
Copy link

codecov bot commented Sep 23, 2021

Codecov Report

Merging #842 (193ebaf) into master (cb459af) will increase coverage by 0.2%.
The diff coverage is 76.1%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #842     +/-   ##
========================================
+ Coverage    56.8%   57.0%   +0.2%     
========================================
  Files         144     144             
  Lines       10695   10807    +112     
========================================
+ Hits         6077    6165     +88     
- Misses       4618    4642     +24     
Impacted Files Coverage Δ
labgrid/remote/client.py 44.6% <42.8%> (-0.1%) ⬇️
labgrid/driver/common.py 81.4% <83.3%> (+0.5%) ⬆️
labgrid/binding.py 92.4% <90.0%> (-0.5%) ⬇️
labgrid/driver/serialdriver.py 81.0% <90.0%> (+1.3%) ⬆️
labgrid/driver/networkinterfacedriver.py 70.3% <100.0%> (+4.7%) ⬆️
labgrid/driver/provider.py 84.8% <100.0%> (+4.8%) ⬆️
labgrid/exceptions.py 100.0% <100.0%> (ø)
labgrid/strategy/common.py 91.6% <100.0%> (+2.1%) ⬆️
labgrid/target.py 93.2% <100.0%> (+0.7%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb459af...193ebaf. Read the comment docs.

@jluebbe jluebbe merged commit b1229ff into labgrid-project:master Oct 8, 2021
@jluebbe jluebbe deleted the export branch October 8, 2021 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants