| 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 '--persist', | 267 '--persist', |
| 268 '--kvm_pid=%s' % _KVM_PID_FILE, | 268 '--kvm_pid=%s' % _KVM_PID_FILE, |
| 269 stateful_change_flag, | 269 stateful_change_flag, |
| 270 '--src_image=%s' % self.source_image, | 270 '--src_image=%s' % self.source_image, |
| 271 ], enter_chroot=False) | 271 ], enter_chroot=False) |
| 272 | 272 |
| 273 def VerifyImage(self, percent_required_to_pass): | 273 def VerifyImage(self, percent_required_to_pass): |
| 274 """Runs vm smoke suite to verify image.""" | 274 """Runs vm smoke suite to verify image.""" |
| 275 # image_to_live already verifies lsb-release matching. This is just | 275 # image_to_live already verifies lsb-release matching. This is just |
| 276 # for additional steps. | 276 # for additional steps. |
| 277 output = RunCommand(['%s/cros_run_vm_test' % self.crosutilsbin, | 277 |
| 278 '--image_path=%s' % self.vm_image_path, | 278 commandWithArgs = ['%s/cros_run_vm_test' % self.crosutilsbin, |
| 279 '--snapshot', | 279 '--image_path=%s' % self.vm_image_path, |
| 280 '--persist', | 280 '--snapshot', |
| 281 vm_graphics_flag, | 281 '--persist', |
| 282 '--kvm_pid=%s' % _KVM_PID_FILE, | 282 '--kvm_pid=%s' % _KVM_PID_FILE, |
| 283 '--test_case=%s' % _VERIFY_SUITE, | 283 _VERIFY_SUITE, |
| 284 ], error_ok=True, enter_chroot=False, | 284 ] |
| 285 redirect_stdout=True) | 285 |
| 286 if vm_graphics_flag: |
| 287 commandWithArgs.append(vm_graphics_flag) |
| 288 |
| 289 output = RunCommand(commandWithArgs, error_ok=True, enter_chroot=False, |
| 290 redirect_stdout=True) |
| 286 return self.CommonVerifyImage(self, output, percent_required_to_pass) | 291 return self.CommonVerifyImage(self, output, percent_required_to_pass) |
| 287 | 292 |
| 288 | 293 |
| 289 if __name__ == '__main__': | 294 if __name__ == '__main__': |
| 290 parser = optparse.OptionParser() | 295 parser = optparse.OptionParser() |
| 291 parser.add_option('-b', '--base_image', | 296 parser.add_option('-b', '--base_image', |
| 292 help='path to the base image.') | 297 help='path to the base image.') |
| 293 parser.add_option('-t', '--target_image', | 298 parser.add_option('-t', '--target_image', |
| 294 help='path to the target image.') | 299 help='path to the target image.') |
| 295 parser.add_option('-r', '--board', | 300 parser.add_option('-r', '--board', |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 else: | 348 else: |
| 344 remote = options.remote | 349 remote = options.remote |
| 345 | 350 |
| 346 suite = unittest.TestLoader().loadTestsFromTestCase(RealAUTest) | 351 suite = unittest.TestLoader().loadTestsFromTestCase(RealAUTest) |
| 347 test_result = unittest.TextTestRunner(verbosity=2).run(suite) | 352 test_result = unittest.TextTestRunner(verbosity=2).run(suite) |
| 348 else: | 353 else: |
| 349 parser.error('Could not parse harness type %s.' % options.type) | 354 parser.error('Could not parse harness type %s.' % options.type) |
| 350 | 355 |
| 351 if not test_result.wasSuccessful(): | 356 if not test_result.wasSuccessful(): |
| 352 Die('Test harness was not successful') | 357 Die('Test harness was not successful') |
| OLD | NEW |