Autotest: Add host class check, and change parameter of
machine_install_by_devserver.
This CL handles two cases:
1. if the DUT has job_url, and pass it into provision_AutoUpdate test as
update_url, the machine_install_by_devserver func will fail since it does
not have a parameter 'update_url'.
2. Only trigger devserver to do auto-update if the host is a CrosHost.
BUG=chromium:638728
TEST=Run /usr/local/autotest/server/autoserv -p -r
/tmp/chromeos2-row3-rack3-host16-16-provision -m chromeos2-row3-rack3-host16
--verbose --lab True --provision --job-labels
cros-version:gandof-release/R54-8630.0.0 on hot.
Run repair/provision_AutoUpdate.double on local autotest.
Change-Id: Ia411f91727516b61e8a9af69b56b1759115f2031
Reviewed-on: https://chromium-review.googlesource.com/375939
Commit-Ready: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
diff --git a/server/afe_utils.py b/server/afe_utils.py
index b6e000e..8c41ef3 100644
--- a/server/afe_utils.py
+++ b/server/afe_utils.py
@@ -230,11 +230,13 @@
"""
clear_version_labels(host)
clear_host_attributes_before_provision(host)
- if not ENABLE_DEVSERVER_TRIGGER_AUTO_UPDATE:
- image_name, host_attributes = host.machine_install(*args, **dargs)
- else:
+ # If ENABLE_DEVSERVER_TRIGGER_AUTO_UPDATE is enabled and the host is a
+ # CrosHost, devserver will be used to trigger auto-update.
+ if host.support_devserver_provision:
image_name, host_attributes = host.machine_install_by_devserver(
*args, **dargs)
+ else:
+ image_name, host_attributes = host.machine_install(*args, **dargs)
for attribute, value in host_attributes.items():
update_host_attribute(host, attribute, value)
add_version_label(host, image_name)