-
Notifications
You must be signed in to change notification settings - Fork 138
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
Create Local Ssh Tunnel keyword gives no info about the success/failure of the Keyword #243
Comments
There is no built-in way to tell if the tunnel was created sucessfully. But you can use |
Thanks for the reply, I did indeed figure out that the tunnel was created successfully! I tried sabotaging the use of the keyword by giving in invalid host too which also returned a success response, I would have expected a fail if the host could not be found at least. It would be good to have some sort of check (whether it's another keyword or part of the Create Local Ssh Tunnel keyword. Just a suggestion going forward! :) |
You're rasing a valid point. I will leave this issue open and implement some sort of keyword log in a future release. |
In my implementation of robot framework, I have a library called sshtunnel which has few keywords like start_ssh_tunnel, stop_sshtunnel with robot ssh libraries connection pool like implementation as well. this library is not integrated with ssh library as it can be used with ssh, rest, db, web automation too. If interested, let me know. |
I have created package and uploaded to pypi. Link to Github - https://github.com/C-Squad/robotframework-sshtunnellibrary |
Great job and thank you for open-sourcing your work! Your library has some useful keywords that, I think, can be also integrated into SSHLibrary as well! |
Thank you. Feel free to take all or any part of the code to integrate. |
Try like below or do not provide last argument. It should work. However I will handle this in code as well. Kindly use sshtunnel repo to raise bugs so that is more relevant place. start ssh tunnel mysql_tunnel xx.xx.xx 22 yh.xx.com 22 myusername |
robot by default send all information as string to python part of code. so all port numbers sent as string so you have faced the issue. I handled in code and published the next version to pypi. please upgrade your package and try. |
thankyou, the new package works well, my testcase now is successfull |
Thanks for providing this library if the SSH_SERVER server needs a pem file along with username and password , is there a way i can pass that in robot framework ? Start SSH Tunnel MySshTunnel ${REMOTE_HOST} ${REMOTE_PORT} ${SSH_SERVER} ${SSH_SERVER_PORT} ${SSH_SERVER_USERNAME} ${SSH_SERVER_PASSWORD} ${LOCAL_HOST} ${LOCAL_PORT} |
I am working with RobotFramework and am trying to use this
Create Local Ssh Tunnel
keyword to open a connection to a MS SQL-Server DB on a remote host so I can run further DB commands.So far if I create the tunnel myself using the following command from the command line:
ssh -fN -L 11433:10.x.x.x:1433 user1@40.x.x.x
And then run a small python program as follows:
This all works fine and I get output.
When I try to do the same from within RF like so:
There is no output from the
Create Local Ssh Tunnel
keyword and I also get the following error when trying to connect to the DB:Is there a way to tell whether the tunnel was created successfully?
The text was updated successfully, but these errors were encountered: