1# Copyright (c) 2010 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
5from autotest_lib.server import utils
6
7AUTHOR = "Chrome OS Team"
8NAME = "firmware_ShellBall"
9TIME = "SHORT"
10TEST_CATEGORY = "Functional"
11TEST_CLASS = "firmware"
12TEST_TYPE = "server"
13
14DOC = """
15chromeos-firmwareupdate functional testing.
16
17This script first copies shellball to DUT and runs all functional tests.
18
19Syntax:
20   ./test_that --board=<BOARD> <IP> -a "xml_config=<xml_config_file>
21   shellball_path=<shellball_directory> shellball_name=<shellball_name>
22   servo_serial=<serial number>" firmware_ShellBall/control
23"""
24from autotest_lib.client.common_lib import error
25
26# Convert autoserv args to something usable.
27opts = dict([[k, v] for (k, _, v) in [x.partition('=') for x in args]])
28
29args_dict = utils.args_to_dict(args)
30servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
31
32def run_shellball(machine):
33    # Verify bios path arg.
34    if 'shellball_path' and 'shellball_name' not in opts:
35        raise error.TestFail('Invalid shellball information.')
36    # Setup the client machine.
37    host = hosts.create_host(machine, servo_args=servo_args)
38    job.run_test("firmware_ShellBall", host=host,
39                 cmdline_args=args,
40                 shellball_path=opts['shellball_path'],
41                 shellball_name=opts['shellball_name'],
42                 disable_sysinfo=True)
43
44parallel_simple(run_shellball, machines)
45