A FAFT test case of corrupting both firmware body A and B.

This test corrupts both firmware body A and B and checks the next boot results.

The expected behavior is different if the firmware preamble USE_RO_NORMAL
flag is enabled. In the case USE_RO_NORMAL ON, the firmware corruption
doesn't hurt the boot results since it boots the RO path directly and does
not load and verify the RW firmware body. In the case USE_RO_NORMAL OFF,
the firmware verification fails on loading RW firmware and enters recovery
mode. In this case, it requires a USB disk plugged-in, which contains a
Chrome OS test image (built by "build_image --test").

BUG=chromium-os:19710;chrome-os-partner:6882
TEST=tested on both USE_RO_NORMAL enabled and disabled devices:
$ run_remote_tests.sh --remote=$REMOTE_IP -a "xml_config=$OVERLAY_XML \
      servo_vid=0x18d1 servo_pid=0x5001" CorruptBothFwBodyAB/control.both

Change-Id: I37661366e41196abacbf78756032ac6af3f1805e
Reviewed-on: https://gerrit.chromium.org/gerrit/12973
Commit-Ready: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
diff --git a/server/site_tests/firmware_CorruptBothFwBodyAB/control.dev b/server/site_tests/firmware_CorruptBothFwBodyAB/control.dev
new file mode 100644
index 0000000..3e159ec
--- /dev/null
+++ b/server/site_tests/firmware_CorruptBothFwBodyAB/control.dev
@@ -0,0 +1,32 @@
+# Copyright (c) 2011 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 = "firmware_CorruptFwBodyAB"
+PURPOSE = "Servo based both firmware body A and B corruption test"
+CRITERIA = "This test will fail if firmware does not enter recovery mode"
+TIME = "LONG"
+TEST_CATEGORY = "Functional"
+TEST_CLASS = "firmware"
+TEST_TYPE = "server"
+
+DOC = """
+This test corrupts both firmware body A and B and checks the next boot results.
+
+The expected behavior is different if the firmware preamble USE_RO_NORMAL
+flag is enabled. In the case USE_RO_NORMAL ON, the firmware corruption 
+doesn't hurt the boot results since it boots the RO path directly and does
+not load and verify the RW firmware body. In the case USE_RO_NORMAL OFF,
+the firmware verification fails on loading RW firmware and enters recovery
+mode. In this case, it requires a USB disk plugged-in, which contains a
+Chrome OS test image (built by "build_image --test").
+"""
+
+def run_corruptbothfwbodyab(machine):
+    host = hosts.create_host(machine)
+    job.run_test("firmware_CorruptBothFwBodyAB", host=host, cmdline_args=args,
+                 use_faft=True, disable_sysinfo=True,
+                 dev_mode=True, tag="dev")
+
+parallel_simple(run_corruptbothfwbodyab, machines)