| 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 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 self.AttemptUpdateWithFilter(DelayedFilter(), proxy_port=8083) | 231 self.AttemptUpdateWithFilter(DelayedFilter(), proxy_port=8083) |
| 232 | 232 |
| 233 def SimpleTest(self): | 233 def SimpleTest(self): |
| 234 """A simple update that updates once from a base image to a target. | 234 """A simple update that updates once from a base image to a target. |
| 235 | 235 |
| 236 We explicitly don't use test prefix so that isn't run by default. Can be | 236 We explicitly don't use test prefix so that isn't run by default. Can be |
| 237 run using test_prefix option. | 237 run using test_prefix option. |
| 238 """ | 238 """ |
| 239 self.worker.InitializeResultsDirectory() | 239 self.worker.InitializeResultsDirectory() |
| 240 self.worker.PrepareBase(self.base_image_path) | 240 self.worker.PrepareBase(self.base_image_path) |
| 241 #self.worker.PerformUpdate(self.target_image_path, self.base_image_path) | 241 self.worker.PerformUpdate(self.target_image_path, self.base_image_path) |
| 242 self.worker.VerifyImage(self) | 242 self.worker.VerifyImage(self) |
| 243 | 243 |
| 244 # --- DISABLED TESTS --- | 244 # --- DISABLED TESTS --- |
| 245 | 245 |
| 246 # TODO(sosa): Get test to work with verbose. | 246 # TODO(sosa): Get test to work with verbose. |
| 247 def NotestPartialUpdate(self): | 247 def NotestPartialUpdate(self): |
| 248 """Tests what happens if we attempt to update with a truncated payload.""" | 248 """Tests what happens if we attempt to update with a truncated payload.""" |
| 249 self.worker.InitializeResultsDirectory() | 249 self.worker.InitializeResultsDirectory() |
| 250 # Preload with the version we are trying to test. | 250 # Preload with the version we are trying to test. |
| 251 self.worker.PrepareBase(self.target_image_path) | 251 self.worker.PrepareBase(self.target_image_path) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 274 url = 'http://gsdview.appspot.com/chromeos-localmirror/' \ | 274 url = 'http://gsdview.appspot.com/chromeos-localmirror/' \ |
| 275 'autest-images/corrupted_image.gz' | 275 'autest-images/corrupted_image.gz' |
| 276 payload = os.path.join(self.download_folder, 'corrupted.gz') | 276 payload = os.path.join(self.download_folder, 'corrupted.gz') |
| 277 | 277 |
| 278 # Read from the URL and write to the local file | 278 # Read from the URL and write to the local file |
| 279 urllib.urlretrieve(url, payload) | 279 urllib.urlretrieve(url, payload) |
| 280 | 280 |
| 281 # This update is expected to fail... | 281 # This update is expected to fail... |
| 282 expected_msg = 'zlib inflate() error:-3' | 282 expected_msg = 'zlib inflate() error:-3' |
| 283 self.AttemptUpdateWithPayloadExpectedFailure(payload, expected_msg) | 283 self.AttemptUpdateWithPayloadExpectedFailure(payload, expected_msg) |
| OLD | NEW |