-
Notifications
You must be signed in to change notification settings - Fork 234
Shelldriver: make destination authorized keys file an arguement #1732
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
base: master
Are you sure you want to change the base?
Shelldriver: make destination authorized keys file an arguement #1732
Conversation
0eebd4b to
75a5828
Compare
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]>
75a5828 to
b56722e
Compare
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
| def _put_ssh_key(self, keyfile_path): | ||
| @step(args=['keyfile_path', 'dest_authorized_keys']) | ||
| def _put_ssh_key(self, keyfile_path, dest_authorized_keys): | ||
| """Upload an SSH Key to a target""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This documentation comment should be moved with the function.
| @Driver.check_active | ||
| def put_ssh_key(self, keyfile_path): | ||
| self._put_ssh_key(keyfile_path) | ||
| def put_ssh_key(self, keyfile_path, dest_authorized_keys = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While moving the documentation comment, please extend it for all arguments of the function.
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
~/.sshand 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
Fixes: #1626