[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/site_autotest.py b/server/site_autotest.py
index 0f9f2a5..fe00835 100755
--- a/server/site_autotest.py
+++ b/server/site_autotest.py
@@ -19,6 +19,7 @@
class SiteAutotest(installable_object.InstallableObject):
+ """Site implementation of Autotest."""
def get(self, location=None):
if not location:
@@ -98,16 +99,19 @@
return repos
- def install(self, host=None, autodir=None):
+ def install(self, host=None, autodir=None, use_packaging=True):
"""Install autotest. If |host| is not None, stores it in |self.host|.
@param host A Host instance on which autotest will be installed
@param autodir Location on the remote host to install to
+ @param use_packaging Enable install modes that use the packaging system.
+
"""
if host:
self.host = host
- super(SiteAutotest, self).install(host=host, autodir=autodir)
+ super(SiteAutotest, self).install(host=host, autodir=autodir,
+ use_packaging=use_packaging)
def _install(self, host=None, autodir=None, use_autoserv=True,