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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 'specified if either is specified.') | 229 'specified if either is specified.') |
230 assert options.private_key and os.path.exists(options.private_key), \ | 230 assert options.private_key and os.path.exists(options.private_key), \ |
231 error_msg % 'private' | 231 error_msg % 'private' |
232 assert options.public_key and os.path.exists(options.public_key), \ | 232 assert options.public_key and os.path.exists(options.public_key), \ |
233 error_msg % 'public' | 233 error_msg % 'public' |
234 | 234 |
235 # Clean up previous work if requested. | 235 # Clean up previous work if requested. |
236 if options.clean: _CleanPreviousWork(options) | 236 if options.clean: _CleanPreviousWork(options) |
237 | 237 |
238 # Make sure we have a log directory. | 238 # Make sure we have a log directory. |
239 if not os.path.exists(options.test_results_root): | 239 if options.test_results_root and not os.path.exists( |
| 240 options.test_results_root): |
240 os.makedirs(options.test_results_root) | 241 os.makedirs(options.test_results_root) |
241 | 242 |
242 # Pre-generate update modifies images by adding public keys to them. | 243 # Pre-generate update modifies images by adding public keys to them. |
243 # Wrap try to make sure we clean this up before we're done. | 244 # Wrap try to make sure we clean this up before we're done. |
244 try: | 245 try: |
245 # Generate cache of updates to use during test harness. | 246 # Generate cache of updates to use during test harness. |
246 update_cache = _PregenerateUpdates(options) | 247 update_cache = _PregenerateUpdates(options) |
247 au_worker.AUWorker.SetUpdateCache(update_cache) | 248 au_worker.AUWorker.SetUpdateCache(update_cache) |
248 | 249 |
249 my_server = dev_server_wrapper.DevServerWrapper( | 250 my_server = dev_server_wrapper.DevServerWrapper( |
(...skipping 18 matching lines...) Expand all Loading... |
268 if options.public_key: | 269 if options.public_key: |
269 cros_lib.Info('Cleaning up. Removing keys added as part of testing.') | 270 cros_lib.Info('Cleaning up. Removing keys added as part of testing.') |
270 target_directory = os.path.dirname(options.target_image) | 271 target_directory = os.path.dirname(options.target_image) |
271 for key_manager in au_test.AUTest.public_key_managers: | 272 for key_manager in au_test.AUTest.public_key_managers: |
272 if key_manager.image_path.startswith(target_directory): | 273 if key_manager.image_path.startswith(target_directory): |
273 key_manager.RemoveKeyFromImage() | 274 key_manager.RemoveKeyFromImage() |
274 | 275 |
275 | 276 |
276 if __name__ == '__main__': | 277 if __name__ == '__main__': |
277 main() | 278 main() |
OLD | NEW |