• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.client.common_lib import error
8from autotest_lib.client.common_lib import utils
9from autotest_lib.client.common_lib.cros import dev_server
10from autotest_lib.server import host_attributes
11
12AUTHOR = "Chrome OS Team"
13NAME = "platform_InstallTestImage.local"
14TIME = "MEDIUM"
15TEST_CATEGORY = "Install"
16TEST_CLASS = "platform"
17TEST_TYPE = "server"
18
19DOC = """
20This test installs an image that's already on the servo usb stick onto a
21servo-connected DUT.
22The principle purpose is to allow installing a known-good image onto
23a wedged unit that would otherwise have to be re-imaged manually.
24
25Here is the command to install a recovery image with a locally attached
26servo:
27    test_that -b ${BOARD} ${IP_ADDRESS} platform_InstallTestImage.local
28"""
29
30args_dict = utils.args_to_dict(args)
31servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
32image_url = args_dict.get("image", None)
33
34def run(machine):
35    # Setup the client machine.
36    host = hosts.create_host(machine, servo_args=servo_args)
37    job.fast = True
38    job.run_test("platform_InstallTestImage", host=host, local=True,
39                 disable_sysinfo=True, image_url=image_url)
40
41parallel_simple(run, machines)
42