| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2011 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 """This module runs a suite of Auto Update tests. | 7 """This module runs a suite of Auto Update tests. |
| 8 | 8 |
| 9 The tests can be run on either a virtual machine or actual device depending | 9 The tests can be run on either a virtual machine or actual device depending |
| 10 on parameters given. Specific tests can be run by invoking --test_prefix. | 10 on parameters given. Specific tests can be run by invoking --test_prefix. |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 _InsertPublicKeyIntoImage(options.base_image, options.public_key) | 273 _InsertPublicKeyIntoImage(options.base_image, options.public_key) |
| 274 options.clean = True | 274 options.clean = True |
| 275 | 275 |
| 276 # Clean up previous work if requested. | 276 # Clean up previous work if requested. |
| 277 if options.clean: _CleanPreviousWork(options) | 277 if options.clean: _CleanPreviousWork(options) |
| 278 | 278 |
| 279 # Generate cache of updates to use during test harness. | 279 # Generate cache of updates to use during test harness. |
| 280 update_cache = _PregenerateUpdates(options) | 280 update_cache = _PregenerateUpdates(options) |
| 281 au_worker.AUWorker.SetUpdateCache(update_cache) | 281 au_worker.AUWorker.SetUpdateCache(update_cache) |
| 282 | 282 |
| 283 my_server = dev_server_wrapper.DevServerWrapper() | 283 my_server = dev_server_wrapper.DevServerWrapper( |
| 284 au_test.AUTest.test_results_root) |
| 284 my_server.start() | 285 my_server.start() |
| 285 try: | 286 try: |
| 286 if options.type == 'vm': | 287 if options.type == 'vm': |
| 287 _RunTestsInParallel(options) | 288 _RunTestsInParallel(options) |
| 288 else: | 289 else: |
| 289 # TODO(sosa) - Take in a machine pool for a real test. | 290 # TODO(sosa) - Take in a machine pool for a real test. |
| 290 # Can't run in parallel with only one remote device. | 291 # Can't run in parallel with only one remote device. |
| 291 test_suite = _PrepareTestSuite(options) | 292 test_suite = _PrepareTestSuite(options) |
| 292 test_result = unittest.TextTestRunner(verbosity=2).run(test_suite) | 293 test_result = unittest.TextTestRunner(verbosity=2).run(test_suite) |
| 293 if not test_result.wasSuccessful(): cros_lib.Die('Test harness failed.') | 294 if not test_result.wasSuccessful(): cros_lib.Die('Test harness failed.') |
| 294 finally: | 295 finally: |
| 295 my_server.Stop() | 296 my_server.Stop() |
| 296 | 297 |
| 297 | 298 |
| 298 if __name__ == '__main__': | 299 if __name__ == '__main__': |
| 299 main() | 300 main() |
| OLD | NEW |