1# Copyright (c) 2012 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.server import test 8from autotest_lib.server.hosts import cros_host 9 10 11class provision_FactoryImage(test.test): 12 """Installs a specified factory image onto a servo-connected DUT.""" 13 version = 1 14 15 def run_once(self, host, image_url): 16 """Install image from URL `image_url` on `host`. 17 18 @param host Host object representing DUT to be re-imaged. 19 @param image_url URL of a test image to be installed. 20 """ 21 logging.info('Installing image from url %s', image_url) 22 #TODO(beeps): once crbug.com/259126 is resolved apply a label. 23 host.servo_install( 24 image_url=image_url, 25 usb_boot_timeout=cros_host.CrosHost.USB_BOOT_TIMEOUT*3, 26 install_timeout=cros_host.CrosHost.INSTALL_TIMEOUT*2) 27