OLD | NEW |
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 14 matching lines...) Expand all Loading... |
25 def __init__(self): | 25 def __init__(self): |
26 super(ExampleController, self).__init__() | 26 super(ExampleController, self).__init__() |
27 self.client1 = None | 27 self.client1 = None |
28 self.client2 = None | 28 self.client2 = None |
29 | 29 |
30 def CreateClient(self): | 30 def CreateClient(self): |
31 """Create a client object and set the proper values.""" | 31 """Create a client object and set the proper values.""" |
32 client = self.NewClient( | 32 client = self.NewClient( |
33 isolate_file='client_test.isolate', | 33 isolate_file='client_test.isolate', |
34 config_vars={'multi_machine': '1'}, | 34 config_vars={'multi_machine': '1'}, |
35 dimensions={'os': 'Linux', 'pool': 'legion'}, priority=200, | 35 dimensions={'os': 'legion-linux'}, priority=200, |
36 idle_timeout_secs=90, connection_timeout_secs=90, | 36 idle_timeout_secs=90, connection_timeout_secs=90, |
37 verbosity=logging.INFO) | 37 verbosity=logging.INFO) |
38 client.Create() | 38 client.Create() |
39 return client | 39 return client |
40 | 40 |
41 def SetUp(self): | 41 def SetUp(self): |
42 """Create the client machines and wait until they connect. | 42 """Create the client machines and wait until they connect. |
43 | 43 |
44 In this call the actual creation of the client machines is done in parallel | 44 In this call the actual creation of the client machines is done in parallel |
45 by the system. The WaitForConnect calls are performed in series but will | 45 by the system. The WaitForConnect calls are performed in series but will |
(...skipping 19 matching lines...) Expand all Loading... |
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 retcode, stdout, stderr = client.rpc.Subprocess( |
69 ['./client_test.py', client.name]) | 69 ['./client_test.py', client.name]) |
70 logging.info('retcode: %s, stdout: %s, stderr: %s', retcode, stdout, stderr) | 70 logging.info('retcode: %s, stdout: %s, stderr: %s', retcode, stdout, stderr) |
71 | 71 |
72 | 72 |
73 if __name__ == '__main__': | 73 if __name__ == '__main__': |
74 ExampleController().RunController() | 74 ExampleController().RunController() |
OLD | NEW |