xref: /aosp_15_r20/external/autotest/server/site_tests/servo_USBInstall/servo_USBInstall.py (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1# Lint as: python2, python3
2# Copyright 2018 The Chromium OS Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6
7from autotest_lib.server import test
8from autotest_lib.server.hosts import repair_utils
9
10
11class servo_USBInstall(test.test):
12    """Force install cros to a dut from servo"""
13    version = 1
14
15    def run_once(self, host):
16        """
17        Force install image from servo to a dut via USB
18
19        @param host Host object representing DUT to be re-imaged.
20        """
21        repair_utils.require_servo(host)
22        _, update_url = host.stage_image_for_servo()
23        host.servo_install(update_url)
24