OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # | 2 # |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Wrapper for tests that are run on builders.""" | 7 """Wrapper for tests that are run on builders.""" |
8 | 8 |
9 import fileinput | 9 import fileinput |
10 import optparse | 10 import optparse |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 zip_server_base: base url for zipped images. | 250 zip_server_base: base url for zipped images. |
251 no_graphics: boolean - If True, disable graphics during vm test. | 251 no_graphics: boolean - If True, disable graphics during vm test. |
252 type: which test harness to run. Possible values: real, vm. | 252 type: which test harness to run. Possible values: real, vm. |
253 remote: ip address for real test harness run. | 253 remote: ip address for real test harness run. |
254 """ | 254 """ |
255 crosutils_root = os.path.join(os.path.dirname(__file__), '..') | 255 crosutils_root = os.path.join(os.path.dirname(__file__), '..') |
256 download_folder = os.path.abspath('latest_download') | 256 download_folder = os.path.abspath('latest_download') |
257 zip_url = GetLatestZipUrl(board, channel, latest_url_base, zip_server_base) | 257 zip_url = GetLatestZipUrl(board, channel, latest_url_base, zip_server_base) |
258 GrabZipAndExtractImage(zip_url, download_folder, _IMAGE_TO_EXTRACT) | 258 GrabZipAndExtractImage(zip_url, download_folder, _IMAGE_TO_EXTRACT) |
259 | 259 |
260 no_graphics_flag = '' | |
261 if no_graphics: no_graphics_flag = '--no_graphics' | |
262 | |
263 # Tests go here. | 260 # Tests go here. |
264 latest_image = RunCommand(['./get_latest_image.sh', '--board=%s' % board], | 261 latest_image = RunCommand(['./get_latest_image.sh', '--board=%s' % board], |
265 cwd=crosutils_root, redirect_stdout=True, | 262 cwd=crosutils_root, redirect_stdout=True, |
266 print_cmd=True).strip() | 263 print_cmd=True).strip() |
267 | 264 |
268 RunCommand(['bin/cros_au_test_harness', | 265 cmd = ['bin/cros_au_test_harness', |
269 '--base_image=%s' % os.path.join(download_folder, | 266 '--base_image=%s' % os.path.join(download_folder, |
270 _IMAGE_TO_EXTRACT), | 267 _IMAGE_TO_EXTRACT), |
271 '--target_image=%s' % os.path.join(latest_image, | 268 '--target_image=%s' % os.path.join(latest_image, |
272 _IMAGE_TO_EXTRACT), | 269 _IMAGE_TO_EXTRACT), |
273 no_graphics_flag, | 270 '--board=%s' % board, |
274 '--board=%s' % board, | 271 '--type=%s' % type, |
275 '--type=%s' % type, | 272 '--remote=%s' % remote, |
276 '--remote=%s' % remote, | 273 ] |
277 ], cwd=crosutils_root) | 274 if no_graphics: cmd.append('--no_graphics') |
| 275 |
| 276 RunCommand(cmd, cwd=crosutils_root) |
278 | 277 |
279 | 278 |
280 def main(): | 279 def main(): |
281 parser = optparse.OptionParser() | 280 parser = optparse.OptionParser() |
282 parser.add_option('-b', '--board', | 281 parser.add_option('-b', '--board', |
283 help='board for the image to compare against.') | 282 help='board for the image to compare against.') |
284 parser.add_option('-c', '--channel', | 283 parser.add_option('-c', '--channel', |
285 help='channel for the image to compare against.') | 284 help='channel for the image to compare against.') |
286 parser.add_option('--cache', default=False, action='store_true', | 285 parser.add_option('--cache', default=False, action='store_true', |
287 help='Cache payloads') | 286 help='Cache payloads') |
(...skipping 29 matching lines...) Expand all Loading... |
317 WipeDevServerCache() | 316 WipeDevServerCache() |
318 | 317 |
319 RunAUTestHarness(options.board, options.channel, options.latestbase, | 318 RunAUTestHarness(options.board, options.channel, options.latestbase, |
320 options.zipbase, options.no_graphics, options.type, | 319 options.zipbase, options.no_graphics, options.type, |
321 options.remote) | 320 options.remote) |
322 | 321 |
323 | 322 |
324 if __name__ == '__main__': | 323 if __name__ == '__main__': |
325 main() | 324 main() |
326 | 325 |
OLD | NEW |