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 # Must run outside the chroot and use src path. |
75 args = [ os.path.join(os.path.dirname(os.path.realpath(__file__)), | 75 args = [ os.path.join(os.path.dirname(os.path.realpath(__file__)), |
76 '../cros_run_vm_test'), | 76 '../cros_run_vm_test'), |
77 '--snapshot', # The image is shared so don't modify it. | 77 '--snapshot', # The image is shared so don't modify it. |
78 '--no_graphics', | 78 '--no_graphics', |
79 '--use_emerged', | 79 '--use_emerged', |
80 '--ssh_port=%d' % ssh_port ] | 80 '--ssh_port=%d' % ssh_port ] |
81 if self._board: args.append('--board=%s' % self._board) | 81 if self._board: args.append('--board=%s' % self._board) |
82 if self._image_path: args.append('--image_path=%s' % self._image_path) | 82 if self._image_path: args.append('--image_path=%s' % self._image_path) |
83 results_dir = None | 83 results_dir = None |
84 if self._results_dir_root: | 84 if self._results_dir_root: |
85 results_dir = '%s/%s.%d' % (self._results_dir_root, test, ssh_port) | 85 results_dir = '%s/%s.%d' % (self._results_dir_root, test, ssh_port) |
86 args.append('--results_dir_root=%s' % results_dir) | 86 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: | 169 if not options.results_dir_root: |
170 Die('--quiet requires --results_dir_root') | 170 Die('--quiet requires --results_dir_root') |
171 runner = ParallelTestRunner(args, options.base_ssh_port, options.board, | 171 runner = ParallelTestRunner(args, options.base_ssh_port, options.board, |
172 options.image_path, options.order_output, | 172 options.image_path, options.order_output, |
173 options.quiet, options.results_dir_root) | 173 options.quiet, options.results_dir_root) |
174 runner.Run() | 174 runner.Run() |
175 | 175 |
176 | 176 |
177 if __name__ == '__main__': | 177 if __name__ == '__main__': |
178 main() | 178 main() |
OLD | NEW |