OLD | NEW |
1 # Copyright 2007 Google Inc. Released under the GPL v2 | 1 # Copyright 2007 Google Inc. Released under the GPL v2 |
2 | 2 |
3 import re, os, sys, traceback, subprocess, time, pickle, glob, tempfile | 3 import re, os, sys, traceback, subprocess, time, pickle, glob, tempfile |
4 import logging, getpass | 4 import logging, getpass |
5 from autotest_lib.server import installable_object, prebuild, utils | 5 from autotest_lib.server import installable_object, prebuild, utils |
6 from autotest_lib.client.common_lib import base_job, log, error, autotemp | 6 from autotest_lib.client.common_lib import base_job, log, error, autotemp |
7 from autotest_lib.client.common_lib import global_config, packages | 7 from autotest_lib.client.common_lib import global_config, packages |
8 from autotest_lib.client.common_lib import utils as client_utils | 8 from autotest_lib.client.common_lib import utils as client_utils |
9 | 9 |
10 AUTOTEST_SVN = 'svn://test.kernel.org/autotest/trunk/client' | 10 AUTOTEST_SVN = 'svn://test.kernel.org/autotest/trunk/client' |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 # make sure there are no files in $AUTODIR/results | 206 # make sure there are no files in $AUTODIR/results |
207 results_path = os.path.join(autodir, 'results') | 207 results_path = os.path.join(autodir, 'results') |
208 host.run('rm -rf %s/*' % utils.sh_escape(results_path), | 208 host.run('rm -rf %s/*' % utils.sh_escape(results_path), |
209 ignore_status=True) | 209 ignore_status=True) |
210 | 210 |
211 # Fetch the autotest client from the nearest repository | 211 # Fetch the autotest client from the nearest repository |
212 if use_packaging: | 212 if use_packaging: |
213 try: | 213 try: |
214 self._install_using_packaging(host, autodir) | 214 self._install_using_packaging(host, autodir) |
215 return | 215 return |
216 except (error.PackageInstallError, error.AutoservRunError, | 216 except global_config.ConfigError, e: |
217 global_config.ConfigError), e: | |
218 logging.info("Could not install autotest using the packaging " | 217 logging.info("Could not install autotest using the packaging " |
219 "system: %s. Trying other methods", e) | 218 "system: %s", e) |
| 219 except (error.PackageInstallError, error.AutoservRunError), e: |
| 220 logging.error("Could not install autotest from repos") |
220 | 221 |
221 # try to install from file or directory | 222 # try to install from file or directory |
222 if self.source_material: | 223 if self.source_material: |
223 c = global_config.global_config | 224 c = global_config.global_config |
224 supports_autoserv_packaging = c.get_config_value( | 225 supports_autoserv_packaging = c.get_config_value( |
225 "PACKAGES", "serve_packages_from_autoserv", type=bool) | 226 "PACKAGES", "serve_packages_from_autoserv", type=bool) |
226 # Copy autotest recursively | 227 # Copy autotest recursively |
227 if supports_autoserv_packaging and use_autoserv: | 228 if supports_autoserv_packaging and use_autoserv: |
228 self._install_using_send_file(host, autodir) | 229 self._install_using_send_file(host, autodir) |
229 else: | 230 else: |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 | 1067 |
1067 @returns: True if the test passes, False otherwise.""" | 1068 @returns: True if the test passes, False otherwise.""" |
1068 at = self._Autotest() | 1069 at = self._Autotest() |
1069 control_file = ('result = job.run_test(%s)\n' | 1070 control_file = ('result = job.run_test(%s)\n' |
1070 'job.set_state("test_result", result)\n') | 1071 'job.set_state("test_result", result)\n') |
1071 test_args = [repr(test_name)] | 1072 test_args = [repr(test_name)] |
1072 test_args += ['%s=%r' % (k, v) for k, v in dargs.iteritems()] | 1073 test_args += ['%s=%r' % (k, v) for k, v in dargs.iteritems()] |
1073 control_file %= ', '.join(test_args) | 1074 control_file %= ', '.join(test_args) |
1074 at.run(control_file, host=self) | 1075 at.run(control_file, host=self) |
1075 return at.job.get_state('test_result', default=False) | 1076 return at.job.get_state('test_result', default=False) |
OLD | NEW |