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 import optparse | 7 import optparse |
8 import os | 8 import os |
9 import re | 9 import re |
10 import sys | 10 import sys |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 if self.data_size > (2 * 1024 * 1024): | 351 if self.data_size > (2 * 1024 * 1024): |
352 self.delay_count += 1 | 352 self.delay_count += 1 |
353 time.sleep(20) | 353 time.sleep(20) |
354 | 354 |
355 self.data_size += len(data) | 355 self.data_size += len(data) |
356 return data | 356 return data |
357 | 357 |
358 self._AttemptUpdateWithFilter(DelayedFilter()) | 358 self._AttemptUpdateWithFilter(DelayedFilter()) |
359 | 359 |
360 def SimpleTest(self): | 360 def SimpleTest(self): |
361 """A simple update that updates the target image to itself. | 361 """A simple update that updates once from a base image to a target. |
362 | 362 |
363 We explicitly don't use test prefix so that isn't run by default. Can be | 363 We explicitly don't use test prefix so that isn't run by default. Can be |
364 run using test_prefix option. | 364 run using test_prefix option. |
365 """ | 365 """ |
366 self.PrepareBase(target_image_path) | 366 self.PrepareBase(base_image_path) |
367 self.UpdateImage(target_image_path) | 367 self.UpdateImage(target_image_path) |
368 self.VerifyImage(100) | 368 self.VerifyImage(100) |
369 | 369 |
370 | 370 |
371 class RealAUTest(unittest.TestCase, AUTest): | 371 class RealAUTest(unittest.TestCase, AUTest): |
372 """Test harness for updating real images.""" | 372 """Test harness for updating real images.""" |
373 | 373 |
374 def setUp(self): | 374 def setUp(self): |
375 AUTest.setUp(self) | 375 AUTest.setUp(self) |
376 | 376 |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 elif options.type == 'real': test_class = RealAUTest | 627 elif options.type == 'real': test_class = RealAUTest |
628 else: parser.error('Could not parse harness type %s.' % options.type) | 628 else: parser.error('Could not parse harness type %s.' % options.type) |
629 | 629 |
630 remote = options.remote | 630 remote = options.remote |
631 | 631 |
632 test_suite = test_loader.loadTestsFromTestCase(test_class) | 632 test_suite = test_loader.loadTestsFromTestCase(test_class) |
633 test_result = unittest.TextTestRunner(verbosity=2).run(test_suite) | 633 test_result = unittest.TextTestRunner(verbosity=2).run(test_suite) |
634 | 634 |
635 if not test_result.wasSuccessful(): | 635 if not test_result.wasSuccessful(): |
636 Die('Test harness was not successful') | 636 Die('Test harness was not successful') |
OLD | NEW |