Remove FakeOmaha usage from update_engine_test
All tests that use FakeOmaha have been migrated to use Nebraska. Delete
references to FakeOmaha and methods that were based around it.
BUG=b:196422953
TEST=None
Change-Id: I99ec3a5b3b7454c66863ee83448dad1c4224d9b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/3346384
Tested-by: Kyle Shimabukuro <kyleshima@chromium.org>
Auto-Submit: Kyle Shimabukuro <kyleshima@chromium.org>
Reviewed-by: David Haddock <dhaddock@chromium.org>
Commit-Queue: Kyle Shimabukuro <kyleshima@chromium.org>
diff --git a/server/cros/update_engine/update_engine_test.py b/server/cros/update_engine/update_engine_test.py
index c9201ed..e06fb7e 100644
--- a/server/cros/update_engine/update_engine_test.py
+++ b/server/cros/update_engine/update_engine_test.py
@@ -31,8 +31,6 @@
from autotest_lib.server import test
from autotest_lib.server.cros import gsutil_wrapper
from autotest_lib.server.cros.dynamic_suite import tools
-from autotest_lib.server.hosts.tls_client import connection
-from autotest_lib.server.hosts.tls_client import fake_omaha
from autotest_lib.utils.frozen_chromite.lib import auto_updater
from autotest_lib.utils.frozen_chromite.lib import auto_updater_transfer
from autotest_lib.utils.frozen_chromite.lib import remote_access
@@ -91,15 +89,12 @@
# Utilities for DLC management
self._dlc_util = dlc_util.DLCUtil(self._run)
- self._fake_omaha = None
self._job_repo_url = None
def cleanup(self):
"""Clean up update_engine autotests."""
if self._host:
self._host.get_file(self._UPDATE_ENGINE_LOG, self.resultsdir)
- if self._fake_omaha:
- self._fake_omaha.stop_omaha()
def _get_expected_events_for_rootfs_update(self, source_release):
@@ -830,111 +825,6 @@
err_msg))
- def get_update_url_for_test(self,
- job_repo_url=None,
- full_payload=True,
- stateful=False,
- moblab=False,
- return_noupdate_starting=2):
- """
- Returns a devserver update URL for tests that cannot use a Nebraska
- instance on the DUT for updating.
-
- This expects the test to set self._host or self._hosts.
-
- @param job_repo_url: string url containing the current build.
- @param full_payload: bool whether we want a full payload.
- @param stateful: bool whether we want to stage stateful payload too.
- @param moblab: bool whether we are running on moblab.
- @param return_noupdate_starting: (Number of times - 1) we want
- FakeOmaha to return an update before
- returning noupdate. 1 means never
- return noupdate. 2 means return
- noupdate after 1 update response.
-
- @returns a valid devserver update URL.
-
- """
- if not moblab and not lsbrelease_utils.is_moblab():
- return self.get_update_url_from_fake_omaha(
- job_repo_url,
- full_payload=full_payload,
- return_noupdate_starting=return_noupdate_starting)
-
- self._job_repo_url = self._get_job_repo_url(job_repo_url)
- if not self._job_repo_url:
- raise error.TestFail('There was no job_repo_url so we cannot get '
- 'a payload to use.')
- ds_url, build = tools.get_devserver_build_from_package_url(
- self._job_repo_url)
-
- # The lab devserver assigned to this test.
- lab_devserver = dev_server.ImageServer(ds_url)
-
- # Stage payloads on the lab devserver.
- self._autotest_devserver = lab_devserver
- artifacts = ['full_payload' if full_payload else 'delta_payload']
- if stateful:
- artifacts.append('stateful')
- self._autotest_devserver.stage_artifacts(build, artifacts)
-
- # Use the same lab devserver to also handle the update.
- url = self._autotest_devserver.get_update_url(build)
-
- logging.info('Update URL: %s', url)
- return url
-
-
- def get_update_url_from_fake_omaha(self,
- job_repo_url=None,
- full_payload=True,
- payload_id='ROOTFS',
- critical_update=True,
- exposed_via_proxy=True,
- return_noupdate_starting=0):
- """
- Starts a FakeOmaha instance with TLS and returns is update url.
-
- Some tests that require an omaha instance to survive a reboot will use
- the FakeOmaha TLS.
-
- @param job_repo_url: string url containing the current build.
- @param full_payload: bool whether we want a full payload.
- @param payload_id: ROOTFS or DLC
- @param critical_update: True if we want a critical update response.
- @param exposed_via_proxy: True to tell TLS we want the fakeomaha to be
- accessible after a reboot.
- @param return_noupdate_starting: int of how many valid update responses
- to return before returning noupdate
- forever.
-
- @returns an update url on the FakeOmaha instance for tests to use.
-
- """
- self._job_repo_url = self._get_job_repo_url(job_repo_url)
- if not self._job_repo_url:
- raise error.TestFail('There was no job_repo_url so we cannot get '
- 'a payload to use.')
- gs = dev_server._get_image_storage_server()
- _, build = tools.get_devserver_build_from_package_url(
- self._job_repo_url)
- target_build = gs + build
- payload_type = 'FULL' if full_payload else 'DELTA'
- tlsconn = connection.TLSConnection()
- self._fake_omaha = fake_omaha.TLSFakeOmaha(tlsconn)
- fake_omaha_url = self._fake_omaha.start_omaha(
- self._host.hostname,
- target_build=target_build,
- payloads=[{
- 'payload_id': payload_id,
- 'payload_type': payload_type,
- }],
- exposed_via_proxy=True,
- critical_update=critical_update,
- return_noupdate_starting=return_noupdate_starting)
- logging.info('Fake Omaha update URL: %s', fake_omaha_url)
- return fake_omaha_url
-
def get_payload_url_on_public_bucket(self, job_repo_url=None,
full_payload=True, is_dlc=False):
"""