| 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 containing class that implements an au_worker for a test device.""" | 5 """Module containing class that implements an au_worker for a test device.""" |
| 6 | 6 |
| 7 import unittest | 7 import unittest |
| 8 | 8 |
| 9 import cros_build_lib as cros_lib | 9 import cros_build_lib as cros_lib |
| 10 | 10 |
| 11 import au_worker | 11 import au_worker |
| 12 | 12 |
| 13 class RealAUWorker(au_worker.AUWorker): | 13 class RealAUWorker(au_worker.AUWorker): |
| 14 """Test harness for updating real images.""" | 14 """Test harness for updating real images.""" |
| 15 | 15 |
| 16 def __init__(self, options, test_results_root): | 16 def __init__(self, options, test_results_root): |
| 17 """Processes non-vm-specific options.""" | 17 """Processes non-vm-specific options.""" |
| 18 au_worker.AUWorker.__init__(self, options, test_results_root) | 18 super(RealAUWorker, self).__init__(options, test_results_root) |
| 19 self.remote = options.remote | 19 self.remote = options.remote |
| 20 if not self.remote: cros_lib.Die('We require a remote address for tests.') | 20 if not self.remote: cros_lib.Die('We require a remote address for tests.') |
| 21 | 21 |
| 22 def PrepareBase(self, image_path): | 22 def PrepareBase(self, image_path): |
| 23 """Auto-update to base image to prepare for test.""" | 23 """Auto-update to base image to prepare for test.""" |
| 24 self.PrepareRealBase(image_path) | 24 self.PrepareRealBase(image_path) |
| 25 | 25 |
| 26 def UpdateImage(self, image_path, src_image_path='', stateful_change='old', | 26 def UpdateImage(self, image_path, src_image_path='', stateful_change='old', |
| 27 proxy_port=None, private_key_path=None): | 27 proxy_port=None, private_key_path=None): |
| 28 """Updates a remote image using image_to_live.sh.""" | 28 """Updates a remote image using image_to_live.sh.""" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 55 output = cros_lib.RunCommand( | 55 output = cros_lib.RunCommand( |
| 56 ['run_remote_tests.sh', | 56 ['run_remote_tests.sh', |
| 57 '--remote=%s' % self.remote, | 57 '--remote=%s' % self.remote, |
| 58 '--results_dir_root=%s' % test_directory, | 58 '--results_dir_root=%s' % test_directory, |
| 59 self.verify_suite, | 59 self.verify_suite, |
| 60 ], error_ok=True, enter_chroot=True, redirect_stdout=True, | 60 ], error_ok=True, enter_chroot=True, redirect_stdout=True, |
| 61 cwd=self.crosutils) | 61 cwd=self.crosutils) |
| 62 return self.AssertEnoughTestsPassed(unittest, output, | 62 return self.AssertEnoughTestsPassed(unittest, output, |
| 63 percent_required_to_pass) | 63 percent_required_to_pass) |
| 64 | 64 |
| OLD | NEW |