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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 base_image = None | 276 base_image = None |
277 if zip_url: | 277 if zip_url: |
278 GrabZipAndExtractImage(zip_url, download_folder, _IMAGE_TO_EXTRACT) | 278 GrabZipAndExtractImage(zip_url, download_folder, _IMAGE_TO_EXTRACT) |
279 base_image = os.path.join(download_folder, _IMAGE_TO_EXTRACT) | 279 base_image = os.path.join(download_folder, _IMAGE_TO_EXTRACT) |
280 else: | 280 else: |
281 base_image = target_image | 281 base_image = target_image |
282 | 282 |
283 update_engine_path = os.path.join(crosutils_root, '..', 'platform', | 283 update_engine_path = os.path.join(crosutils_root, '..', 'platform', |
284 'update_engine') | 284 'update_engine') |
285 | 285 |
286 private_key_path = os.path.join(update_engine_path, 'unittest_key.pem') | 286 if clean: |
287 public_key_path = GeneratePublicKey(private_key_path) | 287 private_key_path = os.path.join(update_engine_path, 'unittest_key.pem') |
| 288 public_key_path = GeneratePublicKey(private_key_path) |
288 | 289 |
289 cmd = ['bin/cros_au_test_harness', | 290 cmd = ['bin/cros_au_test_harness', |
290 '--base_image=%s' % base_image, | 291 '--base_image=%s' % base_image, |
291 '--target_image=%s' % target_image, | 292 '--target_image=%s' % target_image, |
292 '--board=%s' % board, | 293 '--board=%s' % board, |
293 '--type=%s' % type, | 294 '--type=%s' % type, |
294 '--remote=%s' % remote, | 295 '--remote=%s' % remote, |
295 '--private_key=%s' % private_key_path, | |
296 '--public_key=%s' % public_key_path, | |
297 ] | 296 ] |
298 if test_results_root: cmd.append('--test_results_root=%s' % test_results_root) | 297 if test_results_root: cmd.append('--test_results_root=%s' % test_results_root) |
299 if no_graphics: cmd.append('--no_graphics') | 298 if no_graphics: cmd.append('--no_graphics') |
300 if clean: cmd.append('--clean') | 299 # Using keys is only compatible with clean. |
| 300 if clean: |
| 301 cmd.append('--clean') |
| 302 cmd.append('--private_key=%s' % private_key_path) |
| 303 cmd.append('--public_key=%s' % public_key_path) |
301 | 304 |
302 cros_lib.RunCommand(cmd, cwd=crosutils_root) | 305 cros_lib.RunCommand(cmd, cwd=crosutils_root) |
303 | 306 |
304 | 307 |
305 def main(): | 308 def main(): |
306 parser = optparse.OptionParser() | 309 parser = optparse.OptionParser() |
307 parser.add_option('-b', '--board', | 310 parser.add_option('-b', '--board', |
308 help='board for the image to compare against.') | 311 help='board for the image to compare against.') |
309 parser.add_option('-c', '--channel', | 312 parser.add_option('-c', '--channel', |
310 help='channel for the image to compare against.') | 313 help='channel for the image to compare against.') |
(...skipping 21 matching lines...) Expand all Loading... |
332 if not options.zipbase: parser.error('Need zip url base to get images.') | 335 if not options.zipbase: parser.error('Need zip url base to get images.') |
333 | 336 |
334 RunAUTestHarness(options.board, options.channel, options.zipbase, | 337 RunAUTestHarness(options.board, options.channel, options.zipbase, |
335 options.no_graphics, options.type, options.remote, | 338 options.no_graphics, options.type, options.remote, |
336 not options.cache, options.test_results_root) | 339 not options.cache, options.test_results_root) |
337 | 340 |
338 | 341 |
339 if __name__ == '__main__': | 342 if __name__ == '__main__': |
340 main() | 343 main() |
341 | 344 |
OLD | NEW |