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 implementation of an au_worker for virtual machines.""" | 5 """Module containing implementation of an au_worker for virtual machines.""" |
6 | 6 |
7 import os | 7 import os |
8 import threading | 8 import threading |
9 import unittest | 9 import unittest |
10 | 10 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 ] | 96 ] |
97 if proxy_port: cmd.append('--proxy_port=%s' % proxy_port) | 97 if proxy_port: cmd.append('--proxy_port=%s' % proxy_port) |
98 self.RunUpdateCmd(cmd, log_directory) | 98 self.RunUpdateCmd(cmd, log_directory) |
99 | 99 |
100 def VerifyImage(self, unittest, percent_required_to_pass=100): | 100 def VerifyImage(self, unittest, percent_required_to_pass=100): |
101 """Runs vm smoke suite to verify image.""" | 101 """Runs vm smoke suite to verify image.""" |
102 log_directory = self.GetNextResultsPath('verify') | 102 log_directory = self.GetNextResultsPath('verify') |
103 (_, _, log_directory_in_chroot) = log_directory.rpartition('chroot') | 103 (_, _, log_directory_in_chroot) = log_directory.rpartition('chroot') |
104 # image_to_live already verifies lsb-release matching. This is just | 104 # image_to_live already verifies lsb-release matching. This is just |
105 # for additional steps. | 105 # for additional steps. |
106 commandWithArgs = ['%s/cros_run_vm_test' % self.crosutilsbin, | 106 commandWithArgs = ['./cros_run_vm_test', |
107 '--image_path=%s' % self.vm_image_path, | 107 '--image_path=%s' % self.vm_image_path, |
108 '--snapshot', | 108 '--snapshot', |
109 '--persist', | 109 '--persist', |
110 '--kvm_pid=%s' % self._kvm_pid_file, | 110 '--kvm_pid=%s' % self._kvm_pid_file, |
111 '--ssh_port=%s' % self._ssh_port, | 111 '--ssh_port=%s' % self._ssh_port, |
112 '--results_dir_root=%s' % log_directory_in_chroot, | 112 '--results_dir_root=%s' % log_directory_in_chroot, |
113 self.verify_suite, | 113 self.verify_suite, |
114 ] | 114 ] |
115 if self.graphics_flag: commandWithArgs.append(self.graphics_flag) | 115 if self.graphics_flag: commandWithArgs.append(self.graphics_flag) |
116 output = cros_lib.RunCommand(commandWithArgs, error_ok=True, | 116 output = cros_lib.RunCommand(commandWithArgs, error_ok=True, |
117 enter_chroot=False, redirect_stdout=True) | 117 enter_chroot=False, redirect_stdout=True, |
| 118 cwd=self.crosutilsbin) |
118 return self.AssertEnoughTestsPassed(unittest, output, | 119 return self.AssertEnoughTestsPassed(unittest, output, |
119 percent_required_to_pass) | 120 percent_required_to_pass) |
120 | 121 |
OLD | NEW |