xref: /aosp_15_r20/external/autotest/autotest_lib/docs/faft-design-doc.md (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1*9c5db199SXin Li<a name="faft" />
2*9c5db199SXin Li
3*9c5db199SXin Li# FAFT (Fully Automated Firmware Test): Design Doc
4*9c5db199SXin Li
5*9c5db199SXin Li_Self-link: [go/faft-design-doc](https://goto.google.com/faft-design-doc)_
6*9c5db199SXin Li
7*9c5db199SXin Li_Last updated: 2011/11/08_
8*9c5db199SXin Li
9*9c5db199SXin Li- [FAFT (Fully Automated Firmware Test)](#faft)
10*9c5db199SXin Li  - [FAFT Related Documents](#faft-related-documents)
11*9c5db199SXin Li  - [Introduction](#introduction)
12*9c5db199SXin Li  - [Backgrounds](#backgrounds)
13*9c5db199SXin Li  - [State of the Art](#state-of-the-art)
14*9c5db199SXin Li    - [VBoot_Reference Library Tests](#vboot-reference-library-tests)
15*9c5db199SXin Li    - [U-Boot vbexport/vboot Tests](#u-boot-vbexport-vboot-tests)
16*9c5db199SXin Li    - [SAFT (Semi Automated Firmware Test)](#saft-semi-automated-firmware-test)
17*9c5db199SXin Li    - [Factory Regression Testing Using Servo](#factory-regression-testing-using-servo)
18*9c5db199SXin Li    - [U-Boot Test System ](#u-boot-test-system)
19*9c5db199SXin Li  - [FAFT Implementation Details](#faft-implementation-details)
20*9c5db199SXin Li    - [Test Environment](#test-environment)
21*9c5db199SXin Li    - [Test Harness](#test-harness)
22*9c5db199SXin Li    - [Software Architecture](#software-architecture)
23*9c5db199SXin Li    - [Test Case Example](#test-case-example)
24*9c5db199SXin Li  - [FAFT Scopes](#faft-scopes)
25*9c5db199SXin Li    - [Scope 1: Enhance SAFT in Automated Way on Autotest Harness](#scope-1)
26*9c5db199SXin Li    - [Scope 2: Test the Layer of VBExport APIs](#scope-2)
27*9c5db199SXin Li    - [Scope 3: Verify Recovery, Factory Install, Firmware AU, RMA, and Many Complicated Flows](#scope-3)
28*9c5db199SXin Li    - [Scope 4: Monkey Test during Firmware/EC update](#scope-4)
29*9c5db199SXin Li  - [Other Ideas](#other-ideas)
30*9c5db199SXin Li
31*9c5db199SXin Li<a name="faft-related-documents" />
32*9c5db199SXin Li
33*9c5db199SXin Li## FAFT Related Documents
34*9c5db199SXin Li
35*9c5db199SXin Li- [FAFT Setup Instructions](https://chromium.googlesource.com/chromiumos/third_party/autotest/+/refs/heads/main/docs/faft-how-to-run-doc.md)  ([Google specific instructions](http://goto/faft-setup))
36*9c5db199SXin Li- FAFT Test Coverage (Google internal only): [http://goto/faft-coverage](http://goto/faft-coverage)
37*9c5db199SXin Li- FAFT Comparing Existing Manual Test Cases (Google internal only): [http://goto/faft-comparison](http://goto/faft-comparison)
38*9c5db199SXin Li
39*9c5db199SXin Li<a name="introduction" />
40*9c5db199SXin Li
41*9c5db199SXin Li## Introduction
42*9c5db199SXin Li
43*9c5db199SXin LiSecurity is one of the selling points of ChromeOS netbooks. Verified boot provides a solution to ChromeOS security model. In the verified boot design, firmware is the foundation of this secured castle. In addition, part of the firmware is marked as read-only, that means we are unable to patch security holes via autoupdate. So firmware testing is very important; however, our current firmware is lack of automated tests. It only relies on the manual tests by developers, our test team, and dogfooders. It seems to be a risk.
44*9c5db199SXin Li
45*9c5db199SXin LiThis document proposes a solution to the test problem. The advantages of FAFT:
46*9c5db199SXin Li- Fully automatic, no human involved;
47*9c5db199SXin Li- Real test of physical hardware, like USB plug-in, Ctrl-D key press;
48*9c5db199SXin Li- High test coverage of complicated verified boot flows;
49*9c5db199SXin Li- Easy to integrate to our existing test infrastructure, i.e. deploy to test lab, run remotely, continue test, etc.
50*9c5db199SXin Li
51*9c5db199SXin Li<a name="backgrounds" />
52*9c5db199SXin Li
53*9c5db199SXin Li## Backgrounds
54*9c5db199SXin Li
55*9c5db199SXin LiThis document uses [U-Boot](http://en.wikipedia.org/wiki/Das_U-Boot) as an example to discuss the FAFT test approach. It can be also applied to [coreboot](http://en.wikipedia.org/wiki/Coreboot) and any proprietary BIOS in a similar way.
56*9c5db199SXin Li
57*9c5db199SXin LiThe U-Boot software stack looks like the following graph:
58*9c5db199SXin Li
59*9c5db199SXin Li![faft-u-boot-stack](assets/faft-u-boot-stack.png)
60*9c5db199SXin Li
61*9c5db199SXin LiMost of the verified boot logic and crypto algorithms are inside the vboot_reference library. The main control logic in U-Boot is simple, just like reading some headers from SPI and filling them in a data structure which is then passed to vboot_reference.
62*9c5db199SXin Li
63*9c5db199SXin LiThe underlying U-Boot drivers are abstracted into VBoot Export APIs and some (not too many) APIs which the main control logic is used. VBoot export APIs are the most, e.g., TPM, display, keyboard, disk, system related, etc. The main control logic used APIs are not many, e.g., SPI, GPIO, etc. The latter APIs are not included in VBoot Export APIs because some x86 legacy reasons. They may be merged in the future.
64*9c5db199SXin Li
65*9c5db199SXin LiThe firmware boot path is like the following graph:
66*9c5db199SXin Li
67*9c5db199SXin Li![faft-firmware-boot-path](assets/faft-firmware-boot-path.png)
68*9c5db199SXin Li
69*9c5db199SXin LiOur tests are mostly focused on VBoot Bootstub and VBoot Main Firmware since they are complicated and many decision branches. U-Boot initialization and kernel booting are simple and single path decisions. So full system regression tests are enough.
70*9c5db199SXin Li
71*9c5db199SXin Li<a name="state-of-the-art" />
72*9c5db199SXin Li
73*9c5db199SXin Li## State of the Art
74*9c5db199SXin Li
75*9c5db199SXin Li<a name="vboot-reference-library-tests" />
76*9c5db199SXin Li
77*9c5db199SXin Li### VBoot_Reference Library Tests
78*9c5db199SXin Li
79*9c5db199SXin Li
80*9c5db199SXin LiSource: src/platform/vboot_reference/tests
81*9c5db199SXin Li
82*9c5db199SXin Livboot_reference provides a lot of tests varying from crypto algorithms to vboot main logic and control flows. These tests stub the underlying APIs as all success functions. So it is unable to validate the correctness of underlying BIOS platform and the hardware behaviors.
83*9c5db199SXin Li
84*9c5db199SXin Li![faft-vboot-reference-tests](assets/faft-vboot-reference-tests.png)
85*9c5db199SXin Li
86*9c5db199SXin Li<a name="u-boot-vbexport-vboot-tests" />
87*9c5db199SXin Li
88*9c5db199SXin Li### U-Boot vbexport/vboot Tests
89*9c5db199SXin Li
90*9c5db199SXin LiSource: src/third_party/u-boot/files/common/cmd_vb*_test.c
91*9c5db199SXin Li
92*9c5db199SXin LiAlmost all the U-Boot drivers are abstracted into couple of major APIs: VBExport APIs and main logic used driver APIs. U-Boot provides a CLI for manual diagnostic. We wrote some commands to test these APIs. For example, for testing the disk read/write functions, a test command is to write some patterns to the disk and read them back to verify. However, some of these tests needs human involved, like inserting an USB stick to check if it is detectable.
93*9c5db199SXin Li
94*9c5db199SXin Li![faft-u-boot-vbexport-vboot-test](assets/faft-u-boot-vbexport-vboot-test.png)
95*9c5db199SXin Li
96*9c5db199SXin Li<a name="saft-semi-automated-firmware-test" />
97*9c5db199SXin Li
98*9c5db199SXin Li### SAFT (Semi Automated Firmware Test)
99*9c5db199SXin Li
100*9c5db199SXin LiSource: src/platform/saft
101*9c5db199SXin Li
102*9c5db199SXin LiFirst of all, SAFT only works on x86 and hasn’t ported to ARM yet.
103*9c5db199SXin Li
104*9c5db199SXin LiSAFT assumes the whole firmware as a black-box and tests the whole system from firmware, kernel, to rootfs. For example, it corrupts firmware RW A/B to see if it enters recovery mode success. However, SAFT also needs human involved in many cases.
105*9c5db199SXin Li
106*9c5db199SXin Li![faft-saft](assets/faft-saft.png)
107*9c5db199SXin Li
108*9c5db199SXin Li<a name="factory-regression-testing-using-servo" />
109*9c5db199SXin Li
110*9c5db199SXin Li### Factory Regression Testing Using Servo
111*9c5db199SXin Li
112*9c5db199SXin LiDesign Doc: [https://docs.google.com/a/google.com/document/d/1XZgX4_v-Ps7YBRnjZmCFYjrjyBZQz5YmRrg7YWBFfV0/edit?hl=en_US](https://docs.google.com/a/google.com/document/d/1XZgX4_v-Ps7YBRnjZmCFYjrjyBZQz5YmRrg7YWBFfV0/edit?hl=en_US)
113*9c5db199SXin Li
114*9c5db199SXin LiThis work is an on-going project to ensure the whole factory install flow work fine. It downloads a factory bundle from buildbot, setup TFTP and Omaha servers. It uses a mini-Servo board to control a ChromeOS device, like switching dev switch, resetting device, sending Ctrl-D key, etc. This work is done by Rong Chang and the factory team to ensure partners get a good factory bundle.
115*9c5db199SXin Li
116*9c5db199SXin LiSince using a Servo board can automate almost all the human behaviors. The test can be done fully automated. The proposed FAFT in this document is an extension of this work.
117*9c5db199SXin Li
118*9c5db199SXin Li<a name="u-boot-test-system" />
119*9c5db199SXin Li
120*9c5db199SXin Li### U-Boot Test System
121*9c5db199SXin Li
122*9c5db199SXin LiDesign Doc: [https://docs.google.com/a/google.com/document/d/1JorndqNOrEOXgdMRuNBPk1o73XKl1JwCwLkDSOQy7wU/edit?hl=en_US](https://docs.google.com/a/google.com/document/d/1JorndqNOrEOXgdMRuNBPk1o73XKl1JwCwLkDSOQy7wU/edit?hl=en_US)
123*9c5db199SXin Li
124*9c5db199SXin LiSimon proposed a U-Boot native test system to split the U-Boot components into platform code and generic U-Boot code + Verified Bood code. By mocking the platform code. we can test the functions of VBoot library and it integration in a platform-independent way. On the other side, the architecture-specific platform code can be tested in a separated way.
125*9c5db199SXin Li
126*9c5db199SXin Li<a name="faft-implementation-details" />
127*9c5db199SXin Li
128*9c5db199SXin Li## FAFT Implementation Details
129*9c5db199SXin Li
130*9c5db199SXin Li<a name="test-environment" />
131*9c5db199SXin Li
132*9c5db199SXin Li### Test Environment
133*9c5db199SXin Li
134*9c5db199SXin LiWe need a [Servo board](https://chromium.googlesource.com/chromiumos/third_party/hdctools/+/HEAD/docs/servo.md) to connect a DUT such that we can:
135*9c5db199SXin Li
136*9c5db199SXin Li- flash a new firmware image;
137*9c5db199SXin Li- run regression tests;
138*9c5db199SXin Li- simulate lid close, power cycles, gpios, and key presses;
139*9c5db199SXin Li- get console output via UART;
140*9c5db199SXin Li- simulate USB plug in/out, by either muxing a physical USB stick or emulating a USB storage gadget in the host machine.
141*9c5db199SXin Li
142*9c5db199SXin Li![faft-test-environment](assets/faft-test-environment.png)
143*9c5db199SXin Li
144*9c5db199SXin Li<a name="test-harness" />
145*9c5db199SXin Li
146*9c5db199SXin Li### Test Harness
147*9c5db199SXin Li
148*9c5db199SXin LiWe use Autotest as our test harness and run FAFT as server tests. The host uses Ethernet to connect a DUT to push the test commands to it. Since Autotest is widely used in the ChromeOS projects. We can benefit in:
149*9c5db199SXin Li
150*9c5db199SXin Li- easy to integrate to buildbot;
151*9c5db199SXin Li- easy to run remotely;
152*9c5db199SXin Li- easy to deploy to the test lab.
153*9c5db199SXin Li
154*9c5db199SXin LiSome existing works using Servo board test on top on Autotest can be found in:
155*9c5db199SXin Li
156*9c5db199SXin Li- src/third_party/autotest/files/server/site_tests/platform_CloseOpenLid
157*9c5db199SXin Li- src/third_party/autotest/files/server/site_tests/platform_LongPressPower
158*9c5db199SXin Li
159*9c5db199SXin LiFAFT is also based on the existing ServoTest approach and does some enhancements.
160*9c5db199SXin Li
161*9c5db199SXin Li<a name="software-architecture" />
162*9c5db199SXin Li
163*9c5db199SXin Li### Software Architecture
164*9c5db199SXin Li
165*9c5db199SXin LiHere is our proposed FAFT framework. The red pieces are missing and need to be implemented in this project.
166*9c5db199SXin Li
167*9c5db199SXin Li![faft-software-architecture](assets/faft-software-architecture.png)
168*9c5db199SXin Li
169*9c5db199SXin LiAll the FAFT test cases are server side tests, meaning that all the actions are controlled by Host. It is flexible to keep states after sequential reboot. However, we still want to get the DUT state and run some command on it, like getting current firmware version, setting the fw_try_b flag, etc. These actions should be completed in the DUT. So we setup a FAFT Client for this purpose and use RPC to communicate with it.
170*9c5db199SXin Li
171*9c5db199SXin Li<a name="test-case-example" />
172*9c5db199SXin Li
173*9c5db199SXin Li### Test Case Example
174*9c5db199SXin Li
175*9c5db199SXin LiHere is an example to demonstrate how easy it is to write a FAFT test case. It test the firmware like:
176*9c5db199SXin Li1. FW A normal boot -> enable devsw + set try_fwb -> reboot -> press ctrl-d
177*9c5db199SXin Li2. FW B developer boot -> do nothing -> reboot -> press ctrl-d
178*9c5db199SXin Li3. FW A developer boot -> disable devsw -> reboot -> do nothing
179*9c5db199SXin Li4. FW A normal boot -> finished
180*9c5db199SXin Li
181*9c5db199SXin Li```
182*9c5db199SXin Liclass firmware_DevModeTryB(FAFTSequence):
183*9c5db199SXin Li    def run_once(self, host=None):
184*9c5db199SXin Li        self.register_faft_sequence((
185*9c5db199SXin Li            # ------------------------- step 1 -------------------------
186*9c5db199SXin Li            {‘state_checker’: (self.faft_util.crossystem_checker,
187*9c5db199SXin Li                 {‘devsw_boot’: ‘0’, ‘mainfw_type’: ‘normal’, ‘mainfw_act’: ‘A’}),
188*9c5db199SXin Li             ‘userspace_action’: self.enable_devmode_and_set_try_fwb,
189*9c5db199SXin Li             ‘firmware_action’: self.wait_and_press_ctrl_d},
190*9c5db199SXin Li            # ------------------------- step 2 -------------------------
191*9c5db199SXin Li            {‘state_checker’, (self.faft_util.crossystem_checker,
192*9c5db199SXin Li                 {‘devsw_boot’: ‘1’, ‘mainfw_type’: ‘developer’, ‘mainfw_act’: ‘B’}),
193*9c5db199SXin Li             ‘userspace_action’: None,
194*9c5db199SXin Li             ‘firmware_action’: self.wait_and_press_ctrl_d},
195*9c5db199SXin Li            # ------------------------- step 3 -------------------------
196*9c5db199SXin Li            {‘state_checker’, (self.faft_util.crossystem_checker,
197*9c5db199SXin Li                 {‘devsw_boot’: ‘1’, ‘mainfw_type’: ‘developer’, ‘mainfw_act’: ‘A’}),
198*9c5db199SXin Li             ‘userspace_action’: self.servo.disable_development_mode,
199*9c5db199SXin Li             ‘firmware_action’: None},
200*9c5db199SXin Li            # ------------------------- step 4 -------------------------
201*9c5db199SXin Li            {‘state_checker’, (self.faft_util.crossystem_checker,
202*9c5db199SXin Li                 {‘devsw_boot’: ‘0’, ‘mainfw_type’: ‘normal’, ‘mainfw_act’: ‘A’}),
203*9c5db199SXin Li            }
204*9c5db199SXin Li        ))
205*9c5db199SXin Li        self.run_faft_sequence()
206*9c5db199SXin Li
207*9c5db199SXin Li        def enable_devmode_and_set_try_fwb(self):
208*9c5db199SXin Li            self.faft_client.crossystem.set_try_fwb()
209*9c5db199SXin Li            self.servo.enable_development_mode()
210*9c5db199SXin Li
211*9c5db199SXin Li        def wait_and_press_ctrl_d(self):
212*9c5db199SXin Li            time.sleep(10)
213*9c5db199SXin Li            self.servo.ctrl_d()
214*9c5db199SXin Li```
215*9c5db199SXin Li
216*9c5db199SXin Li<a name="faft-scopes" />
217*9c5db199SXin Li
218*9c5db199SXin Li## FAFT Scopes
219*9c5db199SXin Li
220*9c5db199SXin LiThere are several scopes about FAFT.
221*9c5db199SXin Li
222*9c5db199SXin Li<a name="scope-1" />
223*9c5db199SXin Li
224*9c5db199SXin Li### Scope 1: Enhance SAFT in Automated Way on Autotest Harness
225*9c5db199SXin Li
226*9c5db199SXin LiSAFT provides a complete set of libraries to access system info and corrupt/restore firmware and kernel. It also has a set of test cases and expected results. For example, in the SAFT main program, `saft_utility.py`:
227*9c5db199SXin Li
228*9c5db199SXin Li```
229*9c5db199SXin LiTEST_STATE_SEQUENCE = (
230*9c5db199SXin Li    ('1:1:1:0:3', FST.set_try_fw_b),                   # Step 0
231*9c5db199SXin Li    ('1:2:1:0:3', None),
232*9c5db199SXin Li    ('1:1:1:0:3', FST.corrupt_firmware, 'a'),
233*9c5db199SXin Li    ('1:2:1:0:3', FST.restore_firmware, 'a'),
234*9c5db199SXin Li    ('1:1:1:0:3', FST.corrupt_firmware, ('a', 'b')),
235*9c5db199SXin Li    ('5:0:1:1:3', FST.restore_firmware, ('a', 'b')),   # Step 5
236*9c5db199SXin Li    ('1:1:1:0:3', FST.corrupt_kernel, 'a'),
237*9c5db199SXin Li    ('1:1:1:0:5', FST.corrupt_kernel, 'b'),
238*9c5db199SXin Li    ('6:0:1:1:3', FST.restore_kernel, ('a', 'b')),
239*9c5db199SXin Li    ('1:1:1:0:3', FST.request_recovery_boot),
240*9c5db199SXin Li    ('8:0:1:1:3', FST.prepare_tpm_tests),              # Step 10
241*9c5db199SXin Li    ('1:1:1:0:5', FST.move_kernel_backward, 'b'),
242*9c5db199SXin Li    ('6:0:1:1:3', FST.jump_kernels_forward),
243*9c5db199SXin Li    ('1:1:1:0:3', FST.move_firmware_backward, 'a'),
244*9c5db199SXin Li    ('1:2:1:0:3', FST.move_firmware_backward, 'b'),
245*9c5db199SXin Li    ('5:0:1:1:3', FST.jump_firmwares_forward),         # Step 15
246*9c5db199SXin Li    ('1:1:1:0:3', FST.request_recovery_boot),
247*9c5db199SXin Li    ('8:0:1:1:3', FST.terminate_tpm_tests),
248*9c5db199SXin Li    ('*:*:*:*:*', cgpt_st.test_loop),
249*9c5db199SXin Li    ('1:1:1:0:3', FST.revert_firmware),
250*9c5db199SXin Li    ('1:1:1:0:3', None),                               # Step 20
251*9c5db199SXin Li    )
252*9c5db199SXin Li```
253*9c5db199SXin Li
254*9c5db199SXin LiIt is good that we don’t need to reimplement the same work. FAFT still uses the original SAFT test cases and libraries in the first step and port them to Autotest harness. FAFT does a bit modification to makes all test cases automated by using the powerful Servo board functions.
255*9c5db199SXin Li
256*9c5db199SXin LiCurrent SAFT is a sequence of actions and expected results to test all firmware / kernel / recovery / tpm behaviors as a whole. SAFT does tests in this way because we want to simply the human actions, not easy to be confused. Since FAFT can simulate all human actions. We can separate the test sequence more isolated and one for a special test purpose.
257*9c5db199SXin Li
258*9c5db199SXin LiA demo of porting SAFT test cases on FAFT: [https://video.google.com/a/?pli=1#/Play/contentId=60bdda4552e4c6a2](https://video.google.com/a/?pli=1#/Play/contentId=60bdda4552e4c6a2)
259*9c5db199SXin Li
260*9c5db199SXin LiThis demo presents the feasibility of the integration of SAFT library and FAFT framework. We still have a lot of work to make all the features completed. The tasks like:
261*9c5db199SXin Li- Create a separated FAFT client and wrap all existing SAFT libraries into it;
262*9c5db199SXin Li- Setup RPC to invoke FAFT client instead of using SSH tunnel like the demo;
263*9c5db199SXin Li- Enhance the functions of FAFT server side utilities;
264*9c5db199SXin Li- Make FAFT framework more generalized to fit any possible test cases;
265*9c5db199SXin Li- Keep the state and backup firmware/kernel in the server side instead of USB;
266*9c5db199SXin Li- Automatic setup DUT disk and USB image when given a buildbot image.
267*9c5db199SXin Li
268*9c5db199SXin Li<a name="scope-2" />
269*9c5db199SXin Li
270*9c5db199SXin Li### Scope 2: Test the Layer of VBExport APIs
271*9c5db199SXin Li
272*9c5db199SXin LiIn order to increase the test coverage and verify the underlying BIOS functions and drivers, a good entry is to re-run all existing vbexport / vboot tests in an automated way using our test framework!. See more detail in the State of the Art Section. We can catch bugs easily if any drivers changed or the BIOS source rebased.
273*9c5db199SXin Li
274*9c5db199SXin Li![faft-u-boot-vbexport-vboot-test](assets/faft-u-boot-vbexport-vboot-test.png)
275*9c5db199SXin Li
276*9c5db199SXin Li<a name="scope-3" />
277*9c5db199SXin Li
278*9c5db199SXin Li### Scope 3: Verify Recovery, Factory Install, Firmware AU, RMA, and Many Complicated Flows
279*9c5db199SXin Li
280*9c5db199SXin LiThe normal boot and developer boot can be verified by SAFT. However, we still missed the test of the whole Recovery process. The whole recovery sequence is complicated:
281*9c5db199SXin Li1. DD the recovery shim image to a USB stick;
282*9c5db199SXin Li2. Hold Recovery button and power on DUT;
283*9c5db199SXin Li3. Press SPACE;
284*9c5db199SXin Li4. Insert a recovery shim;
285*9c5db199SXin Li5. Wait for the complete of recovery process;
286*9c5db199SXin Li6. Reboot;
287*9c5db199SXin Li7. Boot to normal ChromeOS.
288*9c5db199SXin Li
289*9c5db199SXin LiThis sequence can be fully automated by FAFT. For example, in step 1, we require an USB stick plugged to the Servo board by default. We first mux it to connect to the host machine such that we can write the recovery shim image to it. In step 4, we then mux the USB stick to the DUT. Another approach is to emulate an USB storage gadget in the host machine, it would be more flexible to control its functionalities by software.
290*9c5db199SXin Li
291*9c5db199SXin LiMoreover, there are many recovery mode variants, like normal recovery/devloper recovery, physical recovery button/keyboard simulated button, etc. It’d be easy to verify all variants by writing different test cases.
292*9c5db199SXin Li
293*9c5db199SXin LiBesides, factory install shim, firmware AU, reset shim, RMA, etc, are more complicated and have many variants. Factory install process currently will be tested by an automated script written by the factory team. Firmware AU still relies on manual tests, see the [test matrix](https://docs.google.com/a/google.com/spreadsheet/ccc?key=0AoHv3bO2oLIjdGQ5cnJ6eWc1ZnpjYzlaWFA4T0xlVVE&hl=en_US&authkey=CJWF8-gP#gid=8). Reset shim and RMA has no test yet. Actually, all these complicated flows can be tested in FAFT.
294*9c5db199SXin Li
295*9c5db199SXin Li<a name="scope-4" />
296*9c5db199SXin Li
297*9c5db199SXin Li### Scope 4: Monkey Test during Firmware/EC update
298*9c5db199SXin Li
299*9c5db199SXin LiFirmware/EC update is a risky thing and may brick the machine. For example, the bug [http://crosbug.com/p/4419](http://crosbug.com/p/4419) reported, during the EC update, a user presses Power Button at the same time that bricks the machine. It is because the powerd triggers the shutdown process immediately and the system goes to off, but it cannot be turned on again by power button (until a cold boot). Note that the EC is still in update mode now.
300*9c5db199SXin Li
301*9c5db199SXin Li
302*9c5db199SXin LiTo catch bugs like that, we need a monkey test during firmware/EC update, like randomly switching GPIO, pressing Power Button, closing LID, pressing keyboard, plugging USB/SD disk, etc.
303*9c5db199SXin Li
304*9c5db199SXin Li<a name="other-ideas" />
305*9c5db199SXin Li
306*9c5db199SXin Li## Other Ideas
307*9c5db199SXin Li
308*9c5db199SXin Li- Run FAFT on every build, integrated with buildbot
309*9c5db199SXin Li- Stress test to ensure the stability of hardware and drivers
310*9c5db199SXin Li- Cold reboot test
311*9c5db199SXin Li- Use HDMI capture device or camera + image recognition to verify the display output
312