Skip to content
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

Various issues in SshComputerSetup #516

Open
danielhollas opened this issue Sep 18, 2023 · 3 comments
Open

Various issues in SshComputerSetup #516

danielhollas opened this issue Sep 18, 2023 · 3 comments

Comments

@danielhollas
Copy link
Contributor

When looking at the code of SshComputerSetup I noticed a couple of (apparent) issues.

  • When a config for a given computer already exists, the (potentially) new values are not written. What's worse, the user is not notified about this. In essence this means that user cannot change an existing config
  • When unit testing this widget, we're (repeatadly) writing to an actual .ssh/config file! We need to monkeypatch this.
  • When a private Ssh key already exists, the new value is written to a different file, but this is not correctly propagated to the calling function
@unkcpz
Copy link
Member

unkcpz commented Sep 18, 2023

Also, the issue found in #511 (comment)

I noticed the thread created in the _on_setup_ssh_button_pressed changing the object attributes of the class, there is race condition that needs to be avoided.
The problem is that the real SSH connection part, is difficult to write unid test. Probably it is worth to try https://github.com/carletes/mock-ssh-server and http://sdf.org/

@unkcpz
Copy link
Member

unkcpz commented Sep 18, 2023

@yakutovicha in ssh_copy_id the function call ssh command in subprocess, maybe it is more easy to cache the output and exception with using ssh library for example paramiko? BTW, is there any progress on the ssh light of aiida-core, what is the ssh library used there?

@unkcpz
Copy link
Member

unkcpz commented Oct 6, 2023

When unit testing this widget, we're (repeatadly) writing to an actual .ssh/config file! We need to monkeypatch this.

Was fixed by #523

When a private Ssh key already exists, the new value is written to a different file, but this is not correctly propagated to the calling function

Here is a solution that is needed in my implementation that address other the private key.
44fbdf6

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

No branches or pull requests

2 participants