blob: 6853197714f822c2104aa8c982c22b01bf0235ce [file] [log] [blame]
# Copyright (c) 2010 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.
AUTHOR = "Chrome OS Team"
NAME = "InstallFW"
TIME = "MEDIUM"
TEST_CATEGORY = "Install"
TEST_CLASS = "platform"
TEST_TYPE = "server"
DOC = """
This test install the BIOS/EC on a specified device.
This is useful for testing firmware.
Here is the command to install a given firmware, which is either a raw binary
or a shallball:
run_remote_tests --args='bios_path=<PATH_TO_BIOS_FILE>
bios_name=<NAME_OF_THE_FILE>'
--remote=<IP addres>
--board=<board name>
platform_InstallFW
or install the local shellball (/usr/sbin/chromeos-firmwareupdate) in the
current client image:
run_remote_tests --args='bios_path=local'
--remote=<IP addres>
--board=<board name>
platform_InstallFW
"""
import os
from autotest_lib.client.common_lib import error
# Convert autoserv args to something usable.
opts = dict([[k, v] for (k, _, v) in [x.partition('=') for x in args]])
def run_installfw(machine):
# Verify bios path arg.
if 'bios_path' not in opts:
raise error.TestFail('No --bios_path specified')
# Verify bios_name.
if 'bios_name' not in opts:
if opts['bios_path'] == 'local':
opts['bios_name'] = None
elif os.path.isfile(opts['bios_path']):
opts['bios_name'] = os.path.basename(opts['bios_path'])
opts['bios_path'] = os.path.dirname(opts['bios_path'])
else:
raise error.TestFail('No --bios_name specified')
# Setup the client machine.
host = hosts.create_host(machine)
job.run_test("platform_InstallFW", host=host, bios_path=opts['bios_path'],
bios_name=opts['bios_name'])
parallel_simple(run_installfw, machines)