| 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 that contains the interface for au_test_harness workers. | 5 """Module that contains the interface for au_test_harness workers. |
| 6 | 6 |
| 7 An au test harnss worker is a class that contains the logic for performing | 7 An au test harnss worker is a class that contains the logic for performing |
| 8 and validating updates on a target. This should be subclassed to handle | 8 and validating updates on a target. This should be subclassed to handle |
| 9 various types of target. Types of targets include VM's, real devices, etc. | 9 various types of target. Types of targets include VM's, real devices, etc. |
| 10 """ | 10 """ |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 self.test_results_root = test_results_root | 34 self.test_results_root = test_results_root |
| 35 self.use_delta_updates = options.delta | 35 self.use_delta_updates = options.delta |
| 36 self.verbose = options.verbose | 36 self.verbose = options.verbose |
| 37 self.vm_image_path = None | 37 self.vm_image_path = None |
| 38 if options.quick_test: | 38 if options.quick_test: |
| 39 self.verify_suite = 'build_RootFilesystemSize' | 39 self.verify_suite = 'build_RootFilesystemSize' |
| 40 else: | 40 else: |
| 41 self.verify_suite = 'suite_Smoke' | 41 self.verify_suite = 'suite_Smoke' |
| 42 | 42 |
| 43 # Set these up as they are used often. | 43 # Set these up as they are used often. |
| 44 self.crosutils = cros_lib.CROSUTILS_DIRECTORY | 44 self.crosutils = cros_lib.GetCrosUtilsPath() |
| 45 self.crosutilsbin = os.path.join(self.crosutils, 'bin') | 45 self.crosutilsbin = cros_lib.GetCrosUtilsBinPath() |
| 46 | 46 |
| 47 def CleanUp(self): | 47 def CleanUp(self): |
| 48 """Called at the end of every test.""" | 48 """Called at the end of every test.""" |
| 49 pass | 49 pass |
| 50 | 50 |
| 51 def UpdateImage(self, image_path, src_image_path='', stateful_change='old', | 51 def UpdateImage(self, image_path, src_image_path='', stateful_change='old', |
| 52 proxy_port=None, private_key_path=None): | 52 proxy_port=None, private_key_path=None): |
| 53 """Implementation of an actual update. | 53 """Implementation of an actual update. |
| 54 | 54 |
| 55 See PerformUpdate for description of args. Subclasses must override this | 55 See PerformUpdate for description of args. Subclasses must override this |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 lines = output.split('\n') | 263 lines = output.split('\n') |
| 264 | 264 |
| 265 for line in lines: | 265 for line in lines: |
| 266 if line.startswith("Total PASS:"): | 266 if line.startswith("Total PASS:"): |
| 267 # FORMAT: ^TOTAL PASS: num_passed/num_total (percent%)$ | 267 # FORMAT: ^TOTAL PASS: num_passed/num_total (percent%)$ |
| 268 percent_passed = line.split()[3].strip('()%') | 268 percent_passed = line.split()[3].strip('()%') |
| 269 cros_lib.Info('Percent of tests passed %s' % percent_passed) | 269 cros_lib.Info('Percent of tests passed %s' % percent_passed) |
| 270 break | 270 break |
| 271 | 271 |
| 272 return int(percent_passed) | 272 return int(percent_passed) |
| OLD | NEW |