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

Side by Side Diff: bin/cros_au_test_harness.py

Issue 4109006: Revert to fulls for boths tests if delta fails. (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: Fix line Created 10 years, 1 month 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 | « no previous file | no next file » | 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 sys 9 import sys
10 import unittest 10 import unittest
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 # don't pass many tests. 165 # don't pass many tests.
166 self.PrepareBase() 166 self.PrepareBase()
167 # TODO(sosa): move to 100% once we start testing using the autotest paired 167 # TODO(sosa): move to 100% once we start testing using the autotest paired
168 # with the dev channel. 168 # with the dev channel.
169 percent_passed = self.VerifyImage(10) 169 percent_passed = self.VerifyImage(10)
170 170
171 if self.use_delta_updates: self.source_image = base_image_path 171 if self.use_delta_updates: self.source_image = base_image_path
172 172
173 # Update to - all tests should pass on new image. 173 # Update to - all tests should pass on new image.
174 Info('Updating from base image on vm to target image and wiping stateful.') 174 Info('Updating from base image on vm to target image and wiping stateful.')
175 self.UpdateImage(target_image_path, 'clean') 175 try:
176 self.UpdateImage(target_image_path, 'clean')
177 except:
178 if self.use_delta_updates:
179 Warning('Delta update failed, disabling delta updates and retrying.')
180 self.use_delta_updates = False
181 self.source_image = ''
182 self.UpdateImage(target_image_path)
183 else:
184 raise
185
176 self.VerifyImage(100) 186 self.VerifyImage(100)
177 187
178 if self.use_delta_updates: self.source_image = target_image_path 188 if self.use_delta_updates: self.source_image = target_image_path
179 189
180 # Update from - same percentage should pass that originally passed. 190 # Update from - same percentage should pass that originally passed.
181 Info('Updating from updated image back to base image and wiping stateful.') 191 Info('Updating from updated image back to base image and wiping stateful.')
182 self.UpdateImage(base_image_path, 'clean') 192 self.UpdateImage(base_image_path, 'clean')
183 self.VerifyImage(percent_passed) 193 self.VerifyImage(percent_passed)
184 194
185 195
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 else: 355 else:
346 remote = options.remote 356 remote = options.remote
347 357
348 suite = unittest.TestLoader().loadTestsFromTestCase(RealAUTest) 358 suite = unittest.TestLoader().loadTestsFromTestCase(RealAUTest)
349 test_result = unittest.TextTestRunner(verbosity=2).run(suite) 359 test_result = unittest.TextTestRunner(verbosity=2).run(suite)
350 else: 360 else:
351 parser.error('Could not parse harness type %s.' % options.type) 361 parser.error('Could not parse harness type %s.' % options.type)
352 362
353 if not test_result.wasSuccessful(): 363 if not test_result.wasSuccessful():
354 Die('Test harness was not successful') 364 Die('Test harness was not successful')
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698