blob: 8bc1f4d1745f1052509932a7851c580ab30aa74c [file] [log] [blame]
Tom Wai-Hong Tam9cc6b352011-12-15 11:49:12 +08001# Copyright (c) 2011 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
Tom Wai-Hong Tam9233ebb2012-09-28 19:37:48 +08005from autotest_lib.server import utils
6
Tom Wai-Hong Tam9cc6b352011-12-15 11:49:12 +08007AUTHOR = "Chrome OS Team"
Tom Wai-Hong Tam7b5810f2012-11-12 13:14:26 +08008NAME = "firmware_CorruptBothFwBodyAB"
Tom Wai-Hong Tam9cc6b352011-12-15 11:49:12 +08009PURPOSE = "Servo based both firmware body A and B corruption test"
10CRITERIA = "This test will fail if firmware does not enter recovery mode"
Tom Wai-Hong Tamc67bcc62012-11-01 17:39:27 +080011SUITE = "faft,faft_bios,faft_dev,faft_lv3"
Tom Wai-Hong Tamf6367522013-01-23 09:44:56 +080012TIME = "SHORT"
Tom Wai-Hong Tam9cc6b352011-12-15 11:49:12 +080013TEST_CATEGORY = "Functional"
14TEST_CLASS = "firmware"
15TEST_TYPE = "server"
16
17DOC = """
18This test corrupts both firmware body A and B and checks the next boot results.
19
20The expected behavior is different if the firmware preamble USE_RO_NORMAL
Tom Wai-Hong Tamd6760042012-08-09 16:02:36 +080021flag is enabled. In the case USE_RO_NORMAL ON, the firmware corruption
Tom Wai-Hong Tam9cc6b352011-12-15 11:49:12 +080022doesn't hurt the boot results since it boots the RO path directly and does
23not load and verify the RW firmware body. In the case USE_RO_NORMAL OFF,
24the firmware verification fails on loading RW firmware and enters recovery
25mode. In this case, it requires a USB disk plugged-in, which contains a
26Chrome OS test image (built by "build_image --test").
27"""
28
Tom Wai-Hong Tam9233ebb2012-09-28 19:37:48 +080029args_dict = utils.args_to_dict(args)
Fang Deng0ca40e22013-08-27 17:47:44 -070030servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
Tom Wai-Hong Tam9233ebb2012-09-28 19:37:48 +080031
Tom Wai-Hong Tam9cc6b352011-12-15 11:49:12 +080032def run_corruptbothfwbodyab(machine):
J. Richard Barnette964fba02012-10-24 17:34:29 -070033 host = hosts.create_host(machine, servo_args=servo_args)
Tom Wai-Hong Tam9cc6b352011-12-15 11:49:12 +080034 job.run_test("firmware_CorruptBothFwBodyAB", host=host, cmdline_args=args,
Tom Wai-Hong Tam54f4c582013-07-18 12:05:27 +080035 disable_sysinfo=True, dev_mode=True, tag="dev")
Tom Wai-Hong Tam9cc6b352011-12-15 11:49:12 +080036
37parallel_simple(run_corruptbothfwbodyab, machines)