yanne / api-test

0 stars 0 forks source link

Possibility to run commands via ssh #39

Closed yanne closed 10 years ago

yanne commented 10 years ago

I would like to run a command via ssh from Robot. Reading documentation, it seems that with SSHLibrary, it is not possible to run the equivalent of:

:~$ ssh user@remote.place.com ls

and get back the output

Or am I missing something? If I'm not, can this functionality be done?

This issue was originally opened at Google Code on Nov 4, 2011.

yanne commented 10 years ago

Original comment by pekka.klarck on Nov 5, 2011.

You want to run a command in the system where Robot is running on? Have you tried Run in OperatingSystem library?

yanne commented 10 years ago

Original comment by tatu.kairi@gmail.com on Nov 7, 2011.

OperatingSystems doesen't provide interactive way to run commands. What I need is to run a command via ssh that will then launch interactive session with the user. Your library would fit the bill if you could start a connection with also a command. This is also -- with respect -- something I'd see to be belonging in your library.

yanne commented 10 years ago

Original comment by janne.t....@gmail.com on Jan 15, 2012.

Open Connection host Login username password ${output}= Execute Command ls

Is the way to run a single command over an SSH connection. You can wrap that in a user keyword, so that in a test case it is only a single line. If you want an interactive session, you have to use Write * and Read * -keywords:

Open Connection host Login user password Write cmd ${output} Read Until Prompt Write further input ....

Or is there a scenario that is not covered by these two?

yanne commented 10 years ago

Original comment by janne.t....@gmail.com on Mar 21, 2012.

Closing due to lack of information