[autotest] Disable install autotest from job_repo_url for test_that
use_packing option for autotest._install method is True by default. When using
test_that to run test, DUT will try to install autotest package from
job_repo_url with server configured in global_config (cautotest). For DUT not
located in lab, there is no job_repo_url existed for such DUT in cautotest, and
therefore autotest will try to copy over the local files. However, when a user
try to use a DUT in the lab to run test_that, autotest package is downloaded
and installed from job_repo_url. That leads to a problem that developers can't
use test_that to verify autotest code.
The fix is to add a new option no_use_packaging to autoserv, and thread the
option to autotest._install. The option is set to False by default, and set
to True in test_that. Also, when this argument is set to True, any package
installation will use AutoservFetcher.
BUG=chromium:265673
TEST=run following command and confirm local autotest code is copied over to
the DUT: test_that -b lumpy 172.22.75.225 dummy_Pass
Change-Id: I365f5f7dc79c8e65cddaa0af77f1f1a1e4b0012a
Reviewed-on: https://chromium-review.googlesource.com/169343
Reviewed-by: Mungyung Ryu <mkryu@google.com>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
diff --git a/server/autoserv_utils.py b/server/autoserv_utils.py
index 2db6052..3275fb4 100644
--- a/server/autoserv_utils.py
+++ b/server/autoserv_utils.py
@@ -27,7 +27,8 @@
write_pidfile=True, fast_mode=False,
ssh_verbosity=0,
no_console_prefix=False,
- ssh_options=None,):
+ ssh_options=None,
+ use_packaging=True):
"""
Construct an autoserv command from a job or host queue entry.
@@ -54,7 +55,10 @@
in autoserv console logs.
@param ssh_options: A string giving extra arguments to be tacked on to
ssh commands.
+ @param use_packaging Enable install modes that use the packaging system.
+
@returns The autoserv command line as a list of executable + parameters.
+
"""
command = [os.path.join(autoserv_directory, 'autoserv')]
@@ -107,6 +111,9 @@
command.append('--disable_sysinfo')
command.append('--no_collect_crashinfo')
+ if not use_packaging:
+ command.append('--no_use_packaging')
+
return command + extra_args