2013/4/7 binithb <
bin...@gmail.com>:
>
> This is my first post in the dev group, I must say the work you guys are
> doing is great, the world will be a better place to live now, :) well ,it
> wont stop global warming, but i think a small part of that is true.
Big thanks for kind words! Thinking that Robot Framework, and all the
libraries and tools in the ecosystem, makes the world a better place
made me smile. =)
> Following is the scenario I am in , its related to being able to call
> operating system calls on remote hosts without the need to do a lot of
> things to set things up.
>
> First, existing options which comes to mind/recommended to me were the ssh
> library and remote interface.
> Of these ,
> 1)disadvantage with ssh is that with this model we wont be able to use
> all the features of RF reporting (I wont get complete details of what
> happens after the ssh command gets invoked)
> 2)remote interface requires some effort from the user and it has another
> major disadvantage that I will need to maintain two different copies of user
> level keywords, one for localhost (with OS library) and the other for
> other hosts (using remote library)
You are right about the pros and cons of SSH and Remote approach. It
sounds to me that the latter would work better for you in general.
Unfortunately I haven't yet read this thread (I simply haven't had
much time to spent on these groups). Has anyone proposed importing
libraries using `WITH NAME` there? You could do something like this:
*** Settings ***
Library OperatingSystem WITH NAME local
Library Remote
http://1.2.3.4 WITH NAME 1.2.3.4
*** Test Cases ***
Example
Copy File local /tmp/f1.txt /tmp/f2.txt
Copy File 1.2.3.4 /tmp/f1.txt /tmp/f2.txt
*** Keywords ***
Copy File
[Arguments] ${library} @{args}
Run Keyword ${library}.Copy File @{args}
Note that not recommending the above as a general solution. It should
work, though, and might work well in your context.
> Now , things could be much simple and easier for me if the following feature
> was there.
>
> As a user of RF who has to execute tests all over LAN, ideally I would like
> an operating system library in which all keywords optionally takes an IP
> argument, and when I run this the particular OperatingSystem call it should
> get executed in the host with the IP mentioned as argument.
>
> This way ,
> 1)The interface is simplified ,no need to use remote library.
> 2)since I am only using one library, I just need to maintain one set of
> User keywords, for local as well as other hosts.
The above example should also provide this functionality. Having a
separate library would have a benefit that it would have a more
meaningful name than Remote and no WITH NAME imports would be needed.
I can see that passing the address of the machine where to run the
operation to every call is useful if you are running running
operations on different machines all the time. When running many
commands on a same machine that gets pretty annoying, though, and
using the Switch Operating System Host approach proposed by Kevin in a
reply to this mail would work much better in that case. Ultimately
choices like this depend on the use case.
> Requesting you guys/girls to comment on the following.
>
> 1) To begin with, is my thinking right or am I grossly wrong with my
> understanding of current possibilities. Is my requirement valid/justified ?
As I already commented above, you are mostly right with the
possibilities and limitations of Remote interface.
> 2) If there is scope for this line of functionality, should this library be
> maintained as an external one or is it worth considering it to add the
> remote capability to the existing, default OperatingSystem library (This
> will need approval and time from core team, of course)
I think this library is better hosted as an external library. Using it
anyway requires installing remote servers with OperatingSystem
functionality on the remote machines. Installing the library itself on
the machine where Robot is running wouldn't make the overall
installation process any more complicated.
Cheers,
.peke
--
Agile Tester/Developer/Consultant ::
http://eliga.fi
Lead Developer of Robot Framework ::
http://robotframework.org