Skip to content

Conversation

pmelange
Copy link
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 5 times, most recently from 0eebd4b to 75a5828 Compare September 11, 2025 17:20
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 <[email protected]>
@pmelange pmelange force-pushed the 25.0.1-shelldriver_authorized_keys_file branch from 75a5828 to b56722e Compare September 11, 2025 17:27
Copy link

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.4%. Comparing base (22f4b81) to head (b56722e).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/driver/shelldriver.py 22.7% 17 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (22f4b81) and HEAD (b56722e). Click for more details.

HEAD has 70 uploads less than BASE
Flag BASE (22f4b81) HEAD (b56722e)
3.11 15 1
3.13 15 1
3.12 15 1
3.9 15 1
3.10 15 1
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #1732      +/-   ##
=========================================
- Coverage    55.6%   45.4%   -10.3%     
=========================================
  Files         172     172              
  Lines       13495   13499       +4     
=========================================
- Hits         7514    6131    -1383     
- Misses       5981    7368    +1387     
Flag Coverage Δ
3.10 45.4% <22.7%> (-10.3%) ⬇️
3.11 45.4% <22.7%> (-10.3%) ⬇️
3.12 45.4% <22.7%> (-10.3%) ⬇️
3.13 45.3% <22.7%> (-10.3%) ⬇️
3.9 45.4% <22.7%> (-10.3%) ⬇️

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.

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
1 participant