labgrid icon indicating copy to clipboard operation
labgrid copied to clipboard

client: Allow NetworkService to be manually specified

Open JoshuaWatt opened this issue 2 years ago • 3 comments

If a place doesn't have a NetworkService (commonly when the device does some sort of dynamic IP addressing and tests get the IP address at runtime), the user needs to manually specify the username, hostname, port, and password required to SSH into the device. To facilitate this, add a --host and --password to the labgrid-client command.

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

JoshuaWatt avatar Jun 27 '23 14:06 JoshuaWatt

Codecov Report

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

Project coverage is 62.8%. Comparing base (80595d5) to head (679fea5). Report is 230 commits behind head on master.

Files Patch % Lines
labgrid/remote/client.py 30.3% 23 Missing :warning:
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1225     +/-   ##
========================================
- Coverage    62.9%   62.8%   -0.1%     
========================================
  Files         159     159             
  Lines       11742   11769     +27     
========================================
+ Hits         7391    7401     +10     
- Misses       4351    4368     +17     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 27 '23 14:06 codecov[bot]

I am not fundamentally opposed to this, however I do wonder what the advantage over plain ssh is. Could you elaborate how your usage scenario looks like?

Emantor avatar Sep 06 '23 10:09 Emantor

I am not fundamentally opposed to this, however I do wonder what the advantage over plain ssh is. Could you elaborate how your usage scenario looks like?

Our devices are not directly accessible to be ssh'd into; you have to go through the exporter (labgrid-client ssh would make this quite easy). However, our devices also do automatic IP negotiation, so they don't have a fixed IP address that can be put in a NetworkService to make labgrid-client ssh work. When running pytest this isn't a problem because our strategy knows how to look up the IP address for the device and create a correct NetworkService, but when users are manually interacting with devices, this doesn't work. Instead, (assuming they shell in on the console and look up the device IP address), this patch allows them to specify that IP address so that labgrid-client ssh is useful.

JoshuaWatt avatar Sep 06 '23 14:09 JoshuaWatt

But isn't plain SSH than easier instead of using labgrid?

Emantor avatar Mar 25 '24 09:03 Emantor

Ah of course. ssh USER@IP_ADDRESS -J EXPORTER works, I just didn't think to try that; perhaps suggesting this in the docs would be helpful

JoshuaWatt avatar Mar 25 '24 14:03 JoshuaWatt

Hm, let me look for the correct place to mention this…

Emantor avatar Mar 25 '24 14:03 Emantor