Skip to content

Conversation

@sgross-emlix
Copy link
Contributor

Description

Implement -r and [SOURCES...] [DESTINATION] for scp
Collegues requested this feature since it matches the expectation on how to use the widely known scp command.

Checklist

  • Documentation for the feature
  • PR has been tested

to Target

labgrid@phoebe:~/client$ lgc scp dummy/bar dummy/foo :/tmp
bar                                                                                                                                                                                100%    3     1.2KB/s 00:00
foo                                                                                                                                                                                100%    5     3.3KB/s   00:00
labgrid@phoebe:~/client$ lgc scp -r dummy :/tmp
foo                                                                                                                                                                                100%    5     2.6KB/s   00:00
bar                                                                                                                                                                                100%    3     1.7KB/s   00:00
labgrid@phoebe:~/client$ lgc ssh


BusyBox v1.34.1 () built-in shell (ash)

# cd /tmp
# ls
WebKitCache          bar                  env.yml              foo                  mesa_shader_cache    weston
avahi-daemon.socket  dummy                fontconfig           hsts-storage.sqlite  update-tool.lock
# cd dummy/
# ls
bar  foo

from Target

labgrid@phoebe:~/client$ mkdir rev
labgrid@phoebe:~/client$ lgc scp :/tmp/dummy/foo :/tmp/dummy/bar rev/
foo                                                                                                                                                                                100%    5     1.0KB/s   00:00
bar                                                                                                                                                                                100%    3     0.8KB/s   00:00
labgrid@phoebe:~/client$ lgc scp -r :/tmp/dummy rev
bar                                                                                                                                                                                100%    3     0.4KB/s   00:00
foo    
labgrid@phoebe:~/client$ find rev
rev
rev/dummy
rev/dummy/foo
rev/dummy/bar
rev/foo
rev/bar
  • Man pages have been regenerated

sbngross and others added 4 commits November 10, 2025 11:29
When handling InteractiveCommandError there is an implicit assumption
that it has a field `exitcode`.
This assumption holds since in all places it is raised there is the same
repeated code block.

Make this assumption more explicit by providing a proper constructor to
InteractiveCommandError class.

Signed-off-by: Sebastian Gross <[email protected]>
Users are accustomed to scp having an option for copying recursively as
well as to accept multiple source files.
Meet user expectation by adding well known `-r` option and support for
multiple source files.

Signed-off-by: Sebastian Gross <[email protected]>
Use features of multifile scp driver

Signed-off-by: Sebastian Gross <[email protected]>
@sgross-emlix sgross-emlix force-pushed the feature/ssh-option-recursive branch from f6b4349 to 1cebc8b Compare November 10, 2025 10:30
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 12.00000% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.3%. Comparing base (f63dfd7) to head (1cebc8b).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/remote/client.py 7.6% 12 Missing ⚠️
labgrid/driver/sshdriver.py 16.6% 10 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1769   +/-   ##
======================================
  Coverage    45.3%   45.3%           
======================================
  Files         172     172           
  Lines       13517   13510    -7     
======================================
  Hits         6130    6130           
+ Misses       7387    7380    -7     
Flag Coverage Δ
3.10 45.3% <12.0%> (+<0.1%) ⬆️
3.11 45.3% <12.0%> (+<0.1%) ⬆️
3.12 45.3% <12.0%> (+<0.1%) ⬆️
3.13 45.3% <12.0%> (+<0.1%) ⬆️
3.14 45.3% <12.0%> (+<0.1%) ⬆️
3.9 45.4% <12.0%> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@sgross-emlix
Copy link
Contributor Author

I would like to update tests, but I have no idea where to start. test_sshdriver looks confusing to me

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.

2 participants