Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: testing/legion/examples/hello_world/host_test.py

Issue 870103005: Adding a server side, non-blocking subprocess mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed the GetStd*** names and added some usage docs. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « testing/legion/common_lib.py ('k') | testing/legion/examples/subprocess/client.isolate » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """A simple host test module. 6 """A simple host test module.
7 7
8 This module runs on the host machine and is responsible for creating 2 8 This module runs on the host machine and is responsible for creating 2
9 client machines, waiting for them, and running RPC calls on them. 9 client machines, waiting for them, and running RPC calls on them.
10 """ 10 """
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 def Task(self): 53 def Task(self):
54 """Main method to run the task code.""" 54 """Main method to run the task code."""
55 self.CallEcho(self.client1) 55 self.CallEcho(self.client1)
56 self.CallEcho(self.client2) 56 self.CallEcho(self.client2)
57 self.CallClientTest(self.client1) 57 self.CallClientTest(self.client1)
58 self.CallClientTest(self.client2) 58 self.CallClientTest(self.client2)
59 59
60 def CallEcho(self, client): 60 def CallEcho(self, client):
61 """Call rpc.Echo on a client.""" 61 """Call rpc.Echo on a client."""
62 logging.info('Calling Echo on %s', client.name) 62 logging.info('Calling Echo on %s', client.name)
63 logging.info(self.client1.rpc.Echo(client.name)) 63 logging.info(client.rpc.Echo(client.name))
64 64
65 def CallClientTest(self, client): 65 def CallClientTest(self, client):
66 """Call client_test.py name on a client.""" 66 """Call client_test.py name on a client."""
67 logging.info('Calling Subprocess to run "./client_test.py %s"', client.name) 67 logging.info('Calling Subprocess to run "./client_test.py %s"', client.name)
68 retcode, stdout, stderr = client.rpc.Subprocess( 68 proc = client.rpc.subprocess.Popen(['./client_test.py', client.name])
69 ['./client_test.py', client.name]) 69 client.rpc.subprocess.Wait(proc)
70 retcode = client.rpc.subprocess.GetReturncode(proc)
71 stdout = client.rpc.subprocess.ReadStdout(proc)
72 stderr = client.rpc.subprocess.ReadStderr(proc)
70 logging.info('retcode: %s, stdout: %s, stderr: %s', retcode, stdout, stderr) 73 logging.info('retcode: %s, stdout: %s, stderr: %s', retcode, stdout, stderr)
71 74
72 75
73 if __name__ == '__main__': 76 if __name__ == '__main__':
74 ExampleController().RunController() 77 ExampleController().RunController()
OLDNEW
« no previous file with comments | « testing/legion/common_lib.py ('k') | testing/legion/examples/subprocess/client.isolate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698