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 import optparse | 7 import optparse |
8 import os | 8 import os |
9 import re | 9 import re |
10 import sys | 10 import sys |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 if self.data_size > (2 * 1024 * 1024): | 365 if self.data_size > (2 * 1024 * 1024): |
366 self.delay_count += 1 | 366 self.delay_count += 1 |
367 time.sleep(20) | 367 time.sleep(20) |
368 | 368 |
369 self.data_size += len(data) | 369 self.data_size += len(data) |
370 return data | 370 return data |
371 | 371 |
372 self.AttemptUpdateWithFilter(DelayedFilter()) | 372 self.AttemptUpdateWithFilter(DelayedFilter()) |
373 | 373 |
374 def SimpleTest(self): | 374 def SimpleTest(self): |
375 """A simple update that updates the target image to itself. | 375 """A simple update that updates once from a base image to a target. |
376 | 376 |
377 We explicitly don't use test prefix so that isn't run by default. Can be | 377 We explicitly don't use test prefix so that isn't run by default. Can be |
378 run using test_prefix option. | 378 run using test_prefix option. |
379 """ | 379 """ |
380 self.PrepareBase(self.target_image_path) | 380 self.PrepareBase(self.base_image_path) |
381 self._UpdateImage(self.target_image_path) | 381 self.PerformUpdate(self.target_image_path, self.base_image_path) |
382 self.VerifyImage(100) | 382 self.VerifyImage(100) |
383 | 383 |
384 | 384 |
385 class RealAUTest(unittest.TestCase, AUTest): | 385 class RealAUTest(unittest.TestCase, AUTest): |
386 """Test harness for updating real images.""" | 386 """Test harness for updating real images.""" |
387 | 387 |
388 def setUp(self): | 388 def setUp(self): |
389 AUTest.setUp(self) | 389 AUTest.setUp(self) |
390 | 390 |
391 @classmethod | 391 @classmethod |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 test_loader.testMethodPrefix = options.test_prefix | 638 test_loader.testMethodPrefix = options.test_prefix |
639 test_suite = test_loader.loadTestsFromTestCase(test_class) | 639 test_suite = test_loader.loadTestsFromTestCase(test_class) |
640 test_result = unittest.TextTestRunner(verbosity=2).run(test_suite) | 640 test_result = unittest.TextTestRunner(verbosity=2).run(test_suite) |
641 | 641 |
642 if not test_result.wasSuccessful(): | 642 if not test_result.wasSuccessful(): |
643 Die('Test harness was not successful') | 643 Die('Test harness was not successful') |
644 | 644 |
645 | 645 |
646 if __name__ == '__main__': | 646 if __name__ == '__main__': |
647 main() | 647 main() |
OLD | NEW |