1# Copyright 2020 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import logging 6 7from autotest_lib.client.common_lib import error 8from autotest_lib.client.cros.update_engine import nebraska_wrapper 9from autotest_lib.client.cros.update_engine import update_engine_test 10 11class autoupdate_InstallAndUpdateDLC(update_engine_test.UpdateEngineTest): 12 """Tests installing DLCs and updating them along with the OS. """ 13 version = 1 14 15 def run_once(self, payload_urls, full_payload=True): 16 """ 17 Install DLC and perform an update, using nebraska. 18 19 @param payload_urls: A list containing the platform payload (OS) URL 20 and DLC payload URL(s). The platform payload is 21 required, since DLCs are updated together with 22 the platform. A full DLC payload is required to 23 install the DLC. In case of a delta update, both 24 full and delta DLC payloads should be included in 25 payload_urls. 26 @param full_payload: True for a full payload, False for delta. 27 28 """ 29 with nebraska_wrapper.NebraskaWrapper( 30 payload_url=payload_urls) as nebraska: 31 nebraska_url = nebraska.get_update_url(critical_update=True) 32 logging.debug('Installing sample-dlc') 33 # Nebraska will automatically use the full payload to install DLC. 34 self._dlc_util.install(self._dlc_util._SAMPLE_DLC_ID, nebraska_url) 35 36 if not self._dlc_util.is_installed(self._dlc_util._SAMPLE_DLC_ID): 37 raise error.TestFail('Dummy DLC was not installed.') 38 39 logging.debug('Updating OS and DLC') 40 self._check_for_update(nebraska_url, wait_for_completion=True) 41