OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium OS 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 """Runs tests on VMs in parallel.""" | 6 """Runs tests on VMs in parallel.""" |
7 | 7 |
8 import optparse | 8 import optparse |
9 import os | 9 import os |
10 import subprocess | 10 import subprocess |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 | 64 |
65 Returns: | 65 Returns: |
66 A list of test process info objects containing the following dictionary | 66 A list of test process info objects containing the following dictionary |
67 entries: | 67 entries: |
68 'test': the test name; | 68 'test': the test name; |
69 'proc': the Popen process instance for this test run. | 69 'proc': the Popen process instance for this test run. |
70 """ | 70 """ |
71 ssh_port = self._base_ssh_port | 71 ssh_port = self._base_ssh_port |
72 spawned_tests = [] | 72 spawned_tests = [] |
73 for test in self._tests: | 73 for test in self._tests: |
74 # TODO(sosa): Fix when called from /usr/bin inside the chroot. | 74 args = [ 'cros_run_vm_test', |
petkov
2011/03/30 14:32:16
I assume Popen below does a path lookup?
sosa
2011/03/30 18:35:50
Yes. Re-verified it.
On 2011/03/30 14:32:16, petk
| |
75 args = [ os.path.join(os.path.dirname(os.path.realpath(__file__)), | |
76 '../cros_run_vm_test'), | |
77 '--snapshot', # The image is shared so don't modify it. | 75 '--snapshot', # The image is shared so don't modify it. |
78 '--no_graphics', | 76 '--no_graphics', |
79 '--use_emerged', | 77 '--use_emerged', |
80 '--ssh_port=%d' % ssh_port ] | 78 '--ssh_port=%d' % ssh_port ] |
81 if self._board: args.append('--board=%s' % self._board) | 79 if self._board: args.append('--board=%s' % self._board) |
82 if self._image_path: args.append('--image_path=%s' % self._image_path) | 80 if self._image_path: args.append('--image_path=%s' % self._image_path) |
83 results_dir = None | 81 results_dir = None |
84 if self._results_dir_root: | 82 if self._results_dir_root: |
85 results_dir = '%s/%s.%d' % (self._results_dir_root, test, ssh_port) | 83 results_dir = '%s/%s.%d' % (self._results_dir_root, test, ssh_port) |
86 args.append('--results_dir_root=%s' % results_dir) | 84 args.append('--results_dir_root=%s' % results_dir) |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 if not options.results_dir_root: | 167 if not options.results_dir_root: |
170 Die('--quiet requires --results_dir_root') | 168 Die('--quiet requires --results_dir_root') |
171 runner = ParallelTestRunner(args, options.base_ssh_port, options.board, | 169 runner = ParallelTestRunner(args, options.base_ssh_port, options.board, |
172 options.image_path, options.order_output, | 170 options.image_path, options.order_output, |
173 options.quiet, options.results_dir_root) | 171 options.quiet, options.results_dir_root) |
174 runner.Run() | 172 runner.Run() |
175 | 173 |
176 | 174 |
177 if __name__ == '__main__': | 175 if __name__ == '__main__': |
178 main() | 176 main() |
OLD | NEW |