| || |
How to achieve RPC in python
I am new to Python and want to know if we can achieve below scenario in python?
We have distributed WINDOWS environment for automation testing where several machines are require to complete one test case.
1) we need to check folder & files structure of various machines in testbed.
2) Are some services are running on different machines or not. Based on that restart machine etc.
Our main test case will run from one machine (called execution host) and spawn all objects/process/logs file in that. I have created one python class "CL_FileFolder" which includes all functions related to windows files and folder operations (using python os module).
My test case will create one CL_FileFolder object with Machine1 as an argument and all function call of that object will be called on Machine1..
obj1 = CL_FileFolder(Machine1)
obj2 = CL_FileFolder(Machine2)
now obj1.methods must run on Machie1 and return result to Execution host
obj2.methods must run on Machine2 and return result to Execution host..
Hope I am clear with what I want to achieve..
Pls help me...
I'm sorry, I'm having a hard time figuring out what you're trying to achieve here is. I understand you're new, but I want to challenge you to be as detailed as possible. I think you'll want to spend some time to write in detail what the goal is from a business level first. I get you're trying to check a file, but what I don't get is why, and what's stopping you? If you were doing this manually, what would be the steps you would take?
Next, I sort of get a feeling you're describing something and not very clear of the larger overall systems, platforms, and network topology. Again, I want to challenge you to describe this in good details such that anyone can rebuild your system in their heads. The idea solution could very be different depending on what's in place and what level of skill your team is capable of. For example, that file check (what ever it's checking), it could be done by building an agent that can provide a service endpoint for your "execution host" to call on, or maybe you can run an ftp server on those remote agents and see if you can download the file at the expected path, or you can mount a drive on all those machines to a shared file system that all the machines can access. There's multiple factors that can influence what the better solution would be, so it's very important we understand what the system is exactly.
I would suggest you reword the question, first define the problem and what you are trying to achieve. Then you want to lay out what your system, platform, and network topology out in great details such that someone reading your post should be able to rebuild that world you're working in. They layout how your test framework is designed so we get an idea how it all ties together.
I will share my problem and what I want to achieve in detailed way ASAP.
Hi Hope below explanation will clear your doubts.
Our Test Environment is consist of below windows machine
a) 1 server (SER1), where server component exists and can be handle 100 different clients
b) 2 Client (CL1 & CL2), which get setting and command from server to Scan local system and check process / Services are up or not etc.
I have ClassA written for such function (e.g. getServiceStat(serName) - to return True/False as service is started on the machine or not) who can do it on the systems where it is exists (i.e. on localhost).
But I want to achieve this from one 4th machine (Execution host - EXH1) where I will fire my test case . Test case will create three objects of the same class ClassA with parameter MachineHostName(or ip).
s1 = ClassA(SER1)
c1 = ClassA(CL1)
c2 = ClassA(CL2)
Till now I have created 3 objects on the Execution host (EXH1). ---- Point 1 (clear till this point?)
Now If I call s1.getServiceStat('abc') -- it should give me service status of abc from the server machine
If I call c1.getServiceStat('abc') -- it should give me service status of abc from the Client1 machine
If I call c2.getServiceStat('abc') -- it should give me service status of abc from the Client2 machine
So at the end I will have its return value on EXH1 machine from where I created these objects and invoked its method.....
--------------------------------Point 2 end------------------------
Now any way we can achieve this? using ssh/telnet packages anything....
Please let me know if I am not clear at all.... & Thanks in advance to take time to see it.
I'm still not trying to get what you are trying to accomplish.
I get you have distributed agents, and a test running on a master machine and a couple slaves.
But I'm still coming from a view point of not knowing what you're trying to accomplish or verify, and how they're talking to one another. (the part of not knowing what you're trying to do is more critical in this case).
Sorry to trouble you. But let me explain something more about this, if I get some solution...
Our product installed on multiple client machine (it is standalone desktop application).
Now I my one test case has below steps
1) Install product on Machine 1, Machine 2 and Machine 3
2) Reboot Machine 1, Machine 2 and Machine 3
3) Check folder structure created on machine 1 to 3
4) Check window service (for this product) is up and running on machine 1 to 3
As here multiple machine are involved and reboot is also require, I need to run this test case from another machine (Execution host).
I have created common function library for folder structure check and service check with functions.
How can I automate this? I will create three objects on execution host which has information about these 3 machines (1 to 3).
Now how I can run class methods of these object which will fetch me information about particular client (machine 1 to 3, like windows service run or not or any) on my Execution host.. ?
Tags for this Thread