Remove use of cros_au from autoupdate_StatefulCompatibility
Update the test to use the same procedure as autoupdate_EndToEndTest,
which doesn't involve using the cros_au rpc.
BUG=chromium:1067396
TEST=test_that chromeos6-row16-rack17-host15.cros autoupdate_StatefulCompatibility --autotest_dir ~/trunk/src/third_party/autotest/files --args="source_payload_uri='gs://chromeos-releases/dev-channel/octopus/13250.0.0/payloads/chromeos_13250.0.0_octopus_dev-channel_full_test.bin-gvswgzjqmiytck7ikmyypbe5lla5obte' target_payload_uri='gs://chromeos-releases/dev-channel/octopus/13252.0.0/payloads/chromeos_13252.0.0_octopus_dev-channel_full_test.bin-gvswgzrzgbstaul2casp4qxsukpvlbjz'"
test_that chromeos6-row16-rack17-host1.cros autoupdate_EndToEndTest --autotest_dir ~/trunk/src/third_party/autotest/files --args="source_release=13250.0.0 target_release=13252.0.0 source_payload_uri='gs://chromeos-releases/dev-channel/octopus/13250.0.0/payloads/chromeos_13250.0.0_octopus_dev-channel_full_test.bin-gvswgzjqmiytck7ikmyypbe5lla5obte' target_payload_uri='gs://chromeos-releases/dev-channel/octopus/13252.0.0/payloads/chromeos_13252.0.0_octopus_dev-channel_full_test.bin-gvswgzrzgbstaul2casp4qxsukpvlbjz'"
Change-Id: I7a3ccdf1a70b45737d7ae506d32e5c3f4d9705e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2236156
Commit-Queue: Kyle Shimabukuro <kyleshima@chromium.org>
Tested-by: Kyle Shimabukuro <kyleshima@chromium.org>
Reviewed-by: David Haddock <dhaddock@chromium.org>
diff --git a/server/cros/update_engine/update_engine_test.py b/server/cros/update_engine/update_engine_test.py
index 94cf613..96b5817 100644
--- a/server/cros/update_engine/update_engine_test.py
+++ b/server/cros/update_engine/update_engine_test.py
@@ -636,3 +636,31 @@
logging.info('Payload URL for Nebraska: %s', payload_url)
return payload_url
+
+ def update_device_without_cros_au_rpc(self, cros_device, payload_uri,
+ clobber_stateful=False, tag='source'):
+ """
+ Updates the device.
+
+ Used by autoupdate_EndToEndTest and autoupdate_StatefulCompatibility,
+ which use auto_updater to perform updates.
+
+ @param cros_device: The device to be updated.
+ @param payload_uri: The payload with which the device should be updated.
+ @param clobber_stateful: Boolean that determines whether the stateful
+ of the device should be force updated. By
+ default, set to False
+ @param tag: An identifier string added to each log filename.
+
+ @raise error.TestFail if anything goes wrong with the update.
+
+ """
+ try:
+ cros_device.install_version_without_cros_au_rpc(
+ payload_uri, clobber_stateful=clobber_stateful)
+ except Exception as e:
+ logging.exception('ERROR: Failed to update device.')
+ raise error.TestFail(str(e))
+ finally:
+ self._copy_generated_nebraska_logs(
+ cros_device.cros_updater.request_logs_dir, tag)
diff --git a/server/site_tests/autoupdate_EndToEndTest/autoupdate_EndToEndTest.py b/server/site_tests/autoupdate_EndToEndTest/autoupdate_EndToEndTest.py
index 37bb9ea..f67d73d 100755
--- a/server/site_tests/autoupdate_EndToEndTest/autoupdate_EndToEndTest.py
+++ b/server/site_tests/autoupdate_EndToEndTest/autoupdate_EndToEndTest.py
@@ -74,31 +74,6 @@
raise error.TestFail('Could not find %s' % filename)
- def update_device_without_cros_au_rpc(self, cros_device, payload_uri,
- clobber_stateful=False, tag='source'):
- """Updates the device.
-
- @param cros_device: The device to be updated.
- @param payload_uri: The payload with which the device should be updated.
- @param clobber_stateful: Boolean that determines whether the stateful
- of the device should be force updated. By
- default, set to False
- @param tag: An identifier string added to each log filename.
-
- @raise error.TestFail if anything goes wrong with the update.
-
- """
- try:
- cros_device.install_version_without_cros_au_rpc(
- payload_uri, clobber_stateful=clobber_stateful)
- except Exception as e:
- logging.exception('ERROR: Failed to update device.')
- raise error.TestFail(str(e))
- finally:
- self._copy_generated_nebraska_logs(
- cros_device.cros_updater.request_logs_dir, tag)
-
-
def run_update_test(self, cros_device, test_conf):
"""Runs the update test and checks it succeeded.
diff --git a/server/site_tests/autoupdate_StatefulCompatibility/autoupdate_StatefulCompatibility.py b/server/site_tests/autoupdate_StatefulCompatibility/autoupdate_StatefulCompatibility.py
index 631d69f..31a00bf 100755
--- a/server/site_tests/autoupdate_StatefulCompatibility/autoupdate_StatefulCompatibility.py
+++ b/server/site_tests/autoupdate_StatefulCompatibility/autoupdate_StatefulCompatibility.py
@@ -241,15 +241,6 @@
return metadata['tags']['status'] == 'pass'
- def _stage_payloads_onto_devserver(self):
- """Stages payloads that will be used by the test onto the devserver."""
- logging.info('Staging images onto autotest devserver (%s)',
- self._autotest_devserver.url())
-
- self._stage_payloads(self._source_payload_uri, None)
- self._stage_payloads(self._target_payload_uri, None)
-
-
def run_once(self, test_conf, max_image_checks):
"""Main entry point of the test."""
logging.debug("Using test_conf: %s", test_conf)
@@ -270,7 +261,8 @@
self._autotest_devserver = self._get_devserver_for_test(
{'target_payload_uri': self._target_payload_uri})
- self._stage_payloads_onto_devserver()
+ self._stage_payloads(self._source_payload_uri, None)
+ self._stage_payloads(self._target_payload_uri, None)
# Get an object representing the CrOS DUT.
cros_device = chromiumos_test_platform.ChromiumOSTestPlatform(
@@ -278,11 +270,13 @@
if self._source_payload_uri is not None:
logging.debug('Going to install source image on DUT.')
- cros_device.install_source_image(self._source_payload_uri)
+ self.update_device_without_cros_au_rpc(
+ cros_device, self._source_payload_uri, clobber_stateful=True)
self._run_client_test_and_check_result(self._LOGIN_TEST,
tag='source')
logging.debug('Going to install target image on DUT.')
- cros_device.install_target_image(self._target_payload_uri)
+ self.update_device_without_cros_au_rpc(
+ cros_device, self._target_payload_uri, tag='target')
self._run_client_test_and_check_result(self._LOGIN_TEST, tag='target')