Skip to content
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

sshdriver: support selecting scp mode explicitly #1281

Merged
merged 3 commits into from
Oct 13, 2023

Conversation

ejoerns
Copy link
Contributor

@ejoerns ejoerns commented Oct 12, 2023

Description

OpenSSH >= 9.0 defaults to the SFTP protocol. However, some older targets may only have scp installed. OpenSSH allows to explicitly select scp by providing the -O flag.

As already done for the transition of SFTP, add a dedicated SSHDriver attribute named explicit_scp_mode which defaults to False.

To not call the OpenSSH version check too often, move the call to a @cached_property.

Checklist

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • PR has been tested
  • Man pages have been regenerated

Fixes what was addressed in a comment for #1003

@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (2906645) 63.0% compared to head (fbd0c8b) 63.0%.
Report is 9 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1281     +/-   ##
========================================
- Coverage    63.0%   63.0%   -0.1%     
========================================
  Files         160     160             
  Lines       11865   11902     +37     
========================================
+ Hits         7480    7501     +21     
- Misses       4385    4401     +16     
Files Coverage Δ
labgrid/driver/sshdriver.py 55.5% <44.4%> (-0.7%) ⬇️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

We will use the version multiple times and should not call ssh each time
since we do not expect the ssh version to suddenly change while running
labgrid.

Signed-off-by: Enrico Jorns <[email protected]>
@ejoerns
Copy link
Contributor Author

ejoerns commented Oct 13, 2023

Changes since initial submission:

  • reworked obtaining ssh version by adding a cached property _ssh_version.
  • noted effect on scp() for both explicit_sftp_mode and explicit_scp_mode option

OpenSSH >= 9.0 defaults to the SFTP protocol.
However, some older targets may only have scp installed.
OpenSSH allows to explicitly select scp by providing the -O flag.

As already done for the transition of SFTP, add a dedicated SSHDriver
attribute named 'explicit_scp_mode' which defaults to 'False'.

Signed-off-by: Enrico Jorns <[email protected]>
@jluebbe jluebbe merged commit 0657977 into labgrid-project:master Oct 13, 2023
7 of 9 checks passed
@ejoerns ejoerns deleted the explicit-scp branch October 16, 2023 09:18
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.

3 participants