OLD | NEW |
1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Module containing a test suite that is run to test auto updates.""" | 5 """Module containing a test suite that is run to test auto updates.""" |
6 | 6 |
7 import os | 7 import os |
8 import tempfile | 8 import tempfile |
9 import time | 9 import time |
10 import unittest | 10 import unittest |
11 | 11 |
12 import cros_build_lib as cros_lib | 12 import cros_build_lib as cros_lib |
13 | 13 |
14 import cros_test_proxy | 14 import cros_test_proxy |
15 import dummy_au_worker | 15 import dummy_au_worker |
16 import real_au_worker | 16 import real_au_worker |
17 import vm_au_worker | 17 import vm_au_worker |
18 | 18 |
19 | 19 |
20 class AUTest(unittest.TestCase): | 20 class AUTest(unittest.TestCase): |
21 """Test harness that uses an au_worker to perform and validate updates. | 21 """Test harness that uses an au_worker to perform and validate updates. |
22 | 22 |
23 Defines a test suite that is run using an au_worker. An au_worker can | 23 Defines a test suite that is run using an au_worker. An au_worker can |
24 be created to perform and validates updates on both virtual and real devices. | 24 be created to perform and validates updates on both virtual and real devices. |
25 See documentation for au_worker for more information. | 25 See documentation for au_worker for more information. |
26 """ | 26 """ |
27 test_results_root = None | 27 test_results_root = None |
| 28 public_key_managers = [] |
28 | 29 |
29 @classmethod | 30 @classmethod |
30 def ProcessOptions(cls, options, use_dummy_worker): | 31 def ProcessOptions(cls, options, use_dummy_worker): |
31 """Processes options for the test suite and sets up the worker class. | 32 """Processes options for the test suite and sets up the worker class. |
32 | 33 |
33 Args: | 34 Args: |
34 options: options class to be parsed from main class. | 35 options: options class to be parsed from main class. |
35 use_dummy_worker: If True, use a dummy_worker_class rather than deriving | 36 use_dummy_worker: If True, use a dummy_worker_class rather than deriving |
36 one from options.type. | 37 one from options.type. |
37 """ | 38 """ |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 url = 'http://gsdview.appspot.com/chromeos-localmirror/' \ | 279 url = 'http://gsdview.appspot.com/chromeos-localmirror/' \ |
279 'autest-images/corrupted_image.gz' | 280 'autest-images/corrupted_image.gz' |
280 payload = os.path.join(self.download_folder, 'corrupted.gz') | 281 payload = os.path.join(self.download_folder, 'corrupted.gz') |
281 | 282 |
282 # Read from the URL and write to the local file | 283 # Read from the URL and write to the local file |
283 urllib.urlretrieve(url, payload) | 284 urllib.urlretrieve(url, payload) |
284 | 285 |
285 # This update is expected to fail... | 286 # This update is expected to fail... |
286 expected_msg = 'zlib inflate() error:-3' | 287 expected_msg = 'zlib inflate() error:-3' |
287 self.AttemptUpdateWithPayloadExpectedFailure(payload, expected_msg) | 288 self.AttemptUpdateWithPayloadExpectedFailure(payload, expected_msg) |
OLD | NEW |