Skip to content

sshfs and scp enhancements#1904

Open
Rubusch wants to merge 4 commits into
labgrid-project:masterfrom
Rubusch:lothar/sshfs
Open

sshfs and scp enhancements#1904
Rubusch wants to merge 4 commits into
labgrid-project:masterfrom
Rubusch:lothar/sshfs

Conversation

@Rubusch

@Rubusch Rubusch commented Jun 28, 2026

Copy link
Copy Markdown

Hi! This series would introduce the below described. I'm using this implementation in my labgrid forks, and would like to contribute, if this could be of general interest, too, and fits into your plan. So, please let me know, if it could be of any interest for the upstream labgrid project as well?

Q: Given this makes sense to you guys, I'll probably need to extend the tests/test_sshdriver.py, in case tests then might need to introduce a certain mock implementation. Is this approach ok, or which test approach/test coverage would you expect here?

Q: I'm also unsure, what is actually needed: I think in case the doc/configuration.rst might see a little update, but unsure? Also about doc/usage.rst and doc/development.rst - please let me know roughly, what documentation I'd need to add to this series. Anyway I could give it a try and see what fits.

Note, I'll let updating the Documentation and Manpage generation according to README / description, pending on your feedback on this series. Thanks for reading.


Extend SSH Support

  • Add globbing to scp cmd command
  • Add a daemonized version for sshfs mount/unmount through new --mount and --unmount arguments
  • Mount local storage to remote through sshfs
  • Mount remote storage to local through sshfs

The series will allow the following set of commands (and API accordingly)

$ labgrid-client sshfs remote_dir local_mnt

or

$ labgrid-client sshfs :remote_dir local_mnt

mounts in the foreground and does not come back until signalled

$ labgrid-client sshfs --mount remote_dir local_dir

or

$ labgrid-client sshfs --mount :remote_dir local_dir

mounts in the background, prompt returns, share stays mounted

$ labgrid-client sshfs --unmount local_dir

or

$ labgrid-client sshfs --unmount remote_dir local_dir

or

$ labgrid-client sshfs --unmount :remote_dir local_dir

unmounts local sshfs share, when mounted with '--mount' before

$ labgrid-client sshfs --mount local_dir :remote_mnt

mounts a local dir on a remote mountpoint

$ labgrid-client sshfs --unmount :remote_mnt

or

$ labgrid-client sshfs --unmount local_dir :remote_mnt

unmount a remote mountpoint if mounted before using :remote_mnt

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
  • Man pages have been regenerated

edit: I fixed missing "sshfs" in examples, as remarked by jluebbe

Rubusch added 4 commits June 28, 2026 17:17
Add file globbing, e.g. writing `*.txt` to copy multiple files at once.

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
Add functionality to moung and unmount remote directorys via sshfs on
a local mount point. The labgrid prompt returns, the sshfs share stays
mounted until unmounted.

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
Add the possibility to mount a local folder on a remote host. Open a ssh
connection to the configured SSH target, to issue a remote sshfs mount
command. A running sshd (locally) and sshfs is required to be installed
for this functionality. Then use the ':' to indicate the remote side.

Available commands are then:
----------------------------

$ labgrid-client remote_dir local_mnt
or
$ labgrid-client :remote_dir local_mnt
mounts in the foreground and does not come back until signalled

$ labgrid-client --mount remote_dir local_dir
or
$ labgrid-client --mount :remote_dir local_dir
mounts in the background, prompt returns, share stays mounted

$ labgrid-client --unmount local_dir
or
$ labgrid-client --unmount remote_dir local_dir
or
$ labgrid-client --unmount :remote_dir local_dir
unmounts local sshfs share, when mounted with '--mount' before

$ labgrid-client --mount local_dir :remote_mnt
mounts a local dir on a remote mountpoint

$ labgrid-client --unmount :remote_mnt
or
$ labgrid-client --unmount local_dir :remote_mnt
unmount a remote mountpoint if mounted before using :remote_mnt

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
Add a warning, when permissions of mount point prevent a mounting.

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
@jluebbe

jluebbe commented Jun 29, 2026

Copy link
Copy Markdown
Member

The examples in the description seem to be missing the sshfs subcommand?

@JPEWdev Didn't you do something similar for reverse sshfs, without starting a new SSH connection?

@Rubusch Rubusch changed the title lothar/sshfs driver/sshfs Jul 3, 2026
@Bastian-Krause Bastian-Krause changed the title driver/sshfs sshfs and scp enhancements Jul 7, 2026
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