Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: bin/cros_au_test_harness.py

Issue 6135002: Add simple update test to pfq. (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: iRebased Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « bin/cbuildbot_config.py ('k') | image_to_live.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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')
OLDNEW
« no previous file with comments | « bin/cbuildbot_config.py ('k') | image_to_live.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698