Tom Wai-Hong Tam | 9cc6b35 | 2011-12-15 11:49:12 +0800 | [diff] [blame] | 1 | # 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 Tam | 9233ebb | 2012-09-28 19:37:48 +0800 | [diff] [blame] | 5 | from autotest_lib.server import utils |
| 6 | |
Tom Wai-Hong Tam | 9cc6b35 | 2011-12-15 11:49:12 +0800 | [diff] [blame] | 7 | AUTHOR = "Chrome OS Team" |
Tom Wai-Hong Tam | 7b5810f | 2012-11-12 13:14:26 +0800 | [diff] [blame] | 8 | NAME = "firmware_CorruptBothFwBodyAB" |
Tom Wai-Hong Tam | 9cc6b35 | 2011-12-15 11:49:12 +0800 | [diff] [blame] | 9 | PURPOSE = "Servo based both firmware body A and B corruption test" |
| 10 | CRITERIA = "This test will fail if firmware does not enter recovery mode" |
Tom Wai-Hong Tam | c67bcc6 | 2012-11-01 17:39:27 +0800 | [diff] [blame] | 11 | SUITE = "faft,faft_bios,faft_dev,faft_lv3" |
Tom Wai-Hong Tam | f636752 | 2013-01-23 09:44:56 +0800 | [diff] [blame] | 12 | TIME = "SHORT" |
Tom Wai-Hong Tam | 9cc6b35 | 2011-12-15 11:49:12 +0800 | [diff] [blame] | 13 | TEST_CATEGORY = "Functional" |
| 14 | TEST_CLASS = "firmware" |
| 15 | TEST_TYPE = "server" |
| 16 | |
| 17 | DOC = """ |
| 18 | This test corrupts both firmware body A and B and checks the next boot results. |
| 19 | |
| 20 | The expected behavior is different if the firmware preamble USE_RO_NORMAL |
Tom Wai-Hong Tam | d676004 | 2012-08-09 16:02:36 +0800 | [diff] [blame] | 21 | flag is enabled. In the case USE_RO_NORMAL ON, the firmware corruption |
Tom Wai-Hong Tam | 9cc6b35 | 2011-12-15 11:49:12 +0800 | [diff] [blame] | 22 | doesn't hurt the boot results since it boots the RO path directly and does |
| 23 | not load and verify the RW firmware body. In the case USE_RO_NORMAL OFF, |
| 24 | the firmware verification fails on loading RW firmware and enters recovery |
| 25 | mode. In this case, it requires a USB disk plugged-in, which contains a |
| 26 | Chrome OS test image (built by "build_image --test"). |
| 27 | """ |
| 28 | |
Tom Wai-Hong Tam | 9233ebb | 2012-09-28 19:37:48 +0800 | [diff] [blame] | 29 | args_dict = utils.args_to_dict(args) |
Fang Deng | 0ca40e2 | 2013-08-27 17:47:44 -0700 | [diff] [blame^] | 30 | servo_args = hosts.CrosHost.get_servo_arguments(args_dict) |
Tom Wai-Hong Tam | 9233ebb | 2012-09-28 19:37:48 +0800 | [diff] [blame] | 31 | |
Tom Wai-Hong Tam | 9cc6b35 | 2011-12-15 11:49:12 +0800 | [diff] [blame] | 32 | def run_corruptbothfwbodyab(machine): |
J. Richard Barnette | 964fba0 | 2012-10-24 17:34:29 -0700 | [diff] [blame] | 33 | host = hosts.create_host(machine, servo_args=servo_args) |
Tom Wai-Hong Tam | 9cc6b35 | 2011-12-15 11:49:12 +0800 | [diff] [blame] | 34 | job.run_test("firmware_CorruptBothFwBodyAB", host=host, cmdline_args=args, |
Tom Wai-Hong Tam | 54f4c58 | 2013-07-18 12:05:27 +0800 | [diff] [blame] | 35 | disable_sysinfo=True, dev_mode=True, tag="dev") |
Tom Wai-Hong Tam | 9cc6b35 | 2011-12-15 11:49:12 +0800 | [diff] [blame] | 36 | |
| 37 | parallel_simple(run_corruptbothfwbodyab, machines) |