| OLD | NEW |
| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 220 |
| 221 def PrepareBase(self): | 221 def PrepareBase(self): |
| 222 """Creates an update-able VM based on base image.""" | 222 """Creates an update-able VM based on base image.""" |
| 223 | 223 |
| 224 self.vm_image_path = ('%s/chromiumos_qemu_image.bin' % os.path.dirname( | 224 self.vm_image_path = ('%s/chromiumos_qemu_image.bin' % os.path.dirname( |
| 225 base_image_path)) | 225 base_image_path)) |
| 226 if not os.path.exists(self.vm_image_path): | 226 if not os.path.exists(self.vm_image_path): |
| 227 Info('Qemu image not found, creating one.') | 227 Info('Qemu image not found, creating one.') |
| 228 RunCommand(['%s/image_to_vm.sh' % self.crosutils, | 228 RunCommand(['%s/image_to_vm.sh' % self.crosutils, |
| 229 '--full', | 229 '--full', |
| 230 '--from %s' % ReinterpretPathForChroot( | 230 '--from=%s' % ReinterpretPathForChroot( |
| 231 os.path.dirname(base_image_path)), | 231 os.path.dirname(base_image_path)), |
| 232 '--vdisk_size %s' % _FULL_VDISK_SIZE, | 232 '--vdisk_size=%s' % _FULL_VDISK_SIZE, |
| 233 '--statefulfs_size %s' % _FULL_STATEFULFS_SIZE, | 233 '--statefulfs_size=%s' % _FULL_STATEFULFS_SIZE, |
| 234 '--board %s' % board, | 234 '--board=%s' % board, |
| 235 '--test_image'], enter_chroot=True) | 235 '--test_image'], enter_chroot=True) |
| 236 else: | 236 else: |
| 237 Info('Using existing VM image') | 237 Info('Using existing VM image') |
| 238 | 238 |
| 239 self.assertTrue(os.path.exists(self.vm_image_path)) | 239 self.assertTrue(os.path.exists(self.vm_image_path)) |
| 240 | 240 |
| 241 def UpdateImage(self, image_path, stateful_change='old'): | 241 def UpdateImage(self, image_path, stateful_change='old'): |
| 242 """Updates VM image with image_path.""" | 242 """Updates VM image with image_path.""" |
| 243 stateful_change_flag = self.GetStatefulChangeFlag(stateful_change) | 243 stateful_change_flag = self.GetStatefulChangeFlag(stateful_change) |
| 244 | 244 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 else: | 317 else: |
| 318 remote = options.remote | 318 remote = options.remote |
| 319 | 319 |
| 320 suite = unittest.TestLoader().loadTestsFromTestCase(RealAUTest) | 320 suite = unittest.TestLoader().loadTestsFromTestCase(RealAUTest) |
| 321 test_result = unittest.TextTestRunner(verbosity=2).run(suite) | 321 test_result = unittest.TextTestRunner(verbosity=2).run(suite) |
| 322 else: | 322 else: |
| 323 parser.error('Could not parse harness type %s.' % options.type) | 323 parser.error('Could not parse harness type %s.' % options.type) |
| 324 | 324 |
| 325 if not test_result.wasSuccessful(): | 325 if not test_result.wasSuccessful(): |
| 326 Die('Test harness was not successful') | 326 Die('Test harness was not successful') |
| OLD | NEW |