blob: 288b097e31de3c61481a704dd74bafb19699d7c1 [file] [log] [blame]
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import time
from autotest_lib.server import test
from autotest_lib.client.common_lib import error
class platform_InstallRecoveryImage(test.test):
"""Installs a specified recovery image onto a servo-connected DUT."""
version = 1
def run_once(self, host, image):
make_image_noninteractive=True)'Running the recovery process on the DUT. '
'Will wait up to %d seconds for recovery to '
'complete.', self._RECOVERY_INSTALL_DELAY)
start_time = time.time()
# Wait for the host to come up.
if host.ping_wait_up(timeout=self._RECOVERY_INSTALL_DELAY):'Recovery process completed successfully in '
'%d seconds.', time.time() - start_time)
raise error.TestFail('Host failed to come back up after '
'%d seconds.' % self._RECOVERY_INSTALL_DELAY)'Removing the usb key from the DUT.')