[autotest] Only try to get repo from host attribute if not running in chroot
For test running in chroot using test_that, there is no point to get repo from
host attribute.
BUG=chromium:237512,chromium:479842
TEST=local test_that
test_that -b peppy chromeos1-dshi1.cros dummy_PassServer
confirm the log has no entry like:
FAILED RPC CALL: get_hosts {'hostname': 'chromeos1-dshi1.cros'}
also test scheduler and run a test with scheduler
Change-Id: I40c83b8dca1f16a10fe1df1989b93b21f52be2da
Reviewed-on: https://chromium-review.googlesource.com/269784
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Mungyung Ryu <mkryu@google.com>
Commit-Queue: Dan Shi <dshi@chromium.org>
diff --git a/server/site_autotest.py b/server/site_autotest.py
index fe00835..eafe540 100755
--- a/server/site_autotest.py
+++ b/server/site_autotest.py
@@ -10,6 +10,7 @@
from autotest_lib.client.common_lib import error, global_config
from autotest_lib.client.common_lib.cros import dev_server
from autotest_lib.server import installable_object, autoserv_parser
+from autotest_lib.server import utils as server_utils
from autotest_lib.server.cros.dynamic_suite import tools
from autotest_lib.server.cros.dynamic_suite.constants import JOB_REPO_URL
@@ -83,7 +84,9 @@
devserver_url = dev_server.ImageServer.resolve(image_opt).url()
repo_url = tools.get_package_url(devserver_url, image_opt)
repos.append(repo_url)
- else:
+ elif not server_utils.is_inside_chroot():
+ # Only try to get fetch location from host attribute if the test
+ # is not running inside chroot.
# No --image option was specified, look for the repo url via
# the host attribute. If we are not running with a full AFE
# autoserv will fall back to serving packages itself from whatever