Skip to content

Shelldriver: make destination authorized keys file an arguement#1732

Open
pmelange wants to merge 2 commits intolabgrid-project:masterfrom
pmelange:25.0.1-shelldriver_authorized_keys_file
Open

Shelldriver: make destination authorized keys file an arguement#1732
pmelange wants to merge 2 commits intolabgrid-project:masterfrom
pmelange:25.0.1-shelldriver_authorized_keys_file

Conversation

@pmelange
Copy link
Copy Markdown
Contributor

Description

Change the ShellDriver so that the authorized_keys file can be set to something other than ~/.ssh. This is necessary if the DUT is running dropbear, where the authorized_keys file is located (on OpenWrt) in /etc/dropbear/authorized_keys.

The default value for the new arguement is ~/.ssh and therefore any old code should not need to be updated. In addition, the call to put_ssh_key() has a new optional arg where the user can set the destination authorized_keys file. This could also be useful for setting up a multi-user system and to put the authorized_keys file for each user in their own home directory.

Checklist

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

Fixes: #1626

@pmelange pmelange force-pushed the 25.0.1-shelldriver_authorized_keys_file branch 6 times, most recently from 75a5828 to b56722e Compare September 11, 2025 17:27
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 11, 2025

Codecov Report

❌ Patch coverage is 22.72727% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.8%. Comparing base (c246fab) to head (3f2ab9b).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/driver/shelldriver.py 22.7% 17 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1732   +/-   ##
======================================
  Coverage    45.8%   45.8%           
======================================
  Files         182     182           
  Lines       14718   14722    +4     
======================================
+ Hits         6743    6745    +2     
- Misses       7975    7977    +2     
Flag Coverage Δ
3.10 ?
3.11 45.8% <22.7%> (+<0.1%) ⬆️
3.12 45.8% <22.7%> (+<0.1%) ⬆️
3.13 45.7% <22.7%> (+<0.1%) ⬆️
3.14 45.7% <22.7%> (+<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.

Comment thread labgrid/driver/shelldriver.py Outdated
Comment thread labgrid/driver/shelldriver.py
Add an addition optional arg "dest_authorized_keys" with the default
value of ```~/.ssh/authorized_keys```,

An example where this might be used is when an embedded system uses
dropbear as it's ssh server daemon.  In such a case, the authorized_keys
file is ```/etc/dropbear/authorized_keys```

Additionally, the ```put_key_file``` takes an optional
```dest_authorized_keys``` function parameter which defaults to the above arg.

Fixes: #labgrid-project#1626

Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
Move the documentation comment from _put_ssh_key to put_ssh_key along
with adding documentation for the aguements.

Documention needful of reworking introduced in 2c62fd6

Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
@pmelange pmelange force-pushed the 25.0.1-shelldriver_authorized_keys_file branch from bb9f08d to 3f2ab9b Compare April 20, 2026 13:21
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.

Request: ShellDriver: put_ssh_key would benefit from a destination file attribute

2 participants