-
Notifications
You must be signed in to change notification settings - Fork 23
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
Packaging for PyPi #2
Comments
This is not really production quality software, there are no unit tests and it has mostly been a toy project for me to play around and tests different ways to emulate SSH and commands so far. What would be the advantage of having it in pypi? |
Well, I think having a way to mock SSH is helpful in building software for devops, mostly collection of data using ssh. It could, of course be mocked bypassing SSH entirely, but having a way to do it fast and from the code has a lot of value. Look, for example, at what fabric had to go through: fabric/fabric#185 The only other available approach is build custom servers using paramiko. There is also a library which does similar stuff: https://github.com/simon-engledew/sshim But your API , IMHO, is much much better. |
Testing SSH seems to be a problem shared by the unit tests of a set of networking libraries. Looking at the referenced fabric tickets (fabric/fabric#185 fabric/fabric#275) I am also in favor programmatically spawning and defining SSH servers and supported commands from the unit tests during their execution over suggested alternatives. The related fabric tickets reveals a few features they had to implement in their solution:
Are these features that would be needed in MockSSH as well? The reason I am asking this is that I would still like to know more about your personal interest in this issue is before considering packaging something that has no unit tests. Do you think it would be possible to implement good unit test coverage of MockSSH (sshim has unit tests)? Currently MockSSH supports:
Before packaging MockSSH I would like to:
Where are fabric's current ssh unit tests so we can have a look at what their current solution looks like? self ~ $ git clone http://github.com/fabric/fabric
Cloning into 'fabric'...
remote: Reusing existing pack: 15313, done.
remote: Total 15313 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (15313/15313), 7.03 MiB | 697.00 KiB/s, done.
Resolving deltas: 100% (8854/8854), done.
Checking connectivity... done.
self ~ $ grep -lir 'import ssh|from ssh|paramiko' fabric/
self ~ $ Thanks for pointing to https://github.com/simon-engledew/sshim, it's interesting to compare projects with common goals. |
Hi. I'm not a contributor to fabric - so I'm not familiar with their codebase, but the mock ssh implementation is here: cd fabric/tests
tests❯ grep -i SSH server.py fabric/git/master
from fabric.network import disconnect_all, ssh
class TestServer(ssh.ServerInterface):
Test server implementing the 'ssh' lib's server interface parent class.
Mostly just handles the bare minimum necessary to handle SSH-level things
``serve_responses`` function and its ``SSHHandler`` class.
return ssh.OPEN_SUCCEEDED
return ssh.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
return ssh.AUTH_SUCCESSFUL if passed else ssh.AUTH_FAILED
return ssh.AUTH_SUCCESSFUL if self.pubkeys else ssh.AUTH_FAILED As to my personal interest - I require only the ability to fire up an instance, pass it to paramiko, and define output as per input. Personally, for me what you already have would suffice fully. Hopefully, your project would be useful to more people though - I see someone from Rackspace starring it, so maybe they've looked for something similar. |
Created:
It's Friday night and I'm using Emoji on github 😿 |
Thank you! I hope it will become popular, it's already popular with me :)
|
Hi.
Love the idea, could you please package it for pypi?
If you want an easy way, this tool could help:
https://github.com/Infinidat/infi.projector
The text was updated successfully, but these errors were encountered: