xref: /aosp_15_r20/external/flashrom/util/README (revision 0d6140be3aa665ecc836e8907834fcd3e3b018fc)
1*0d6140beSAndroid Build Coastguard WorkerFlashrom Testing
2*0d6140beSAndroid Build Coastguard Worker
3*0d6140beSAndroid Build Coastguard WorkerOverall idea:
4*0d6140beSAndroid Build Coastguard Worker- Break tests into small chunks
5*0d6140beSAndroid Build Coastguard Worker- Have a single program that does generic setup and shutdown functions
6*0d6140beSAndroid Build Coastguard Worker- Executes specified tests in a simple loop
7*0d6140beSAndroid Build Coastguard Worker
8*0d6140beSAndroid Build Coastguard WorkerDependencies:
9*0d6140beSAndroid Build Coastguard Worker- uuencode
10*0d6140beSAndroid Build Coastguard Worker- diff
11*0d6140beSAndroid Build Coastguard Worker- A version of flashrom which is installed in $PATH. This is assumed to be a
12*0d6140beSAndroid Build Coastguard Worker  "good" version of Flashrom and will be used to obtain a backup copy of the
13*0d6140beSAndroid Build Coastguard Worker  ROM image at the beginning, and restore the image at the end.
14*0d6140beSAndroid Build Coastguard Worker
15*0d6140beSAndroid Build Coastguard WorkerImportant environment variables:
16*0d6140beSAndroid Build Coastguard WorkerFLASHROM: Path to the Flashrom binary to test
17*0d6140beSAndroid Build Coastguard WorkerFLASHROM_PARAM: Extra parameters to pass into flashrom, such as -p. Do *not*
18*0d6140beSAndroid Build Coastguard Workerspecify chip operations such as read/write/erase/verify here, as they are
19*0d6140beSAndroid Build Coastguard Workerredundant with commands the script executes.
20*0d6140beSAndroid Build Coastguard Worker
21*0d6140beSAndroid Build Coastguard WorkerImportant global variables:
22*0d6140beSAndroid Build Coastguard WorkerBACKUP: The backup copy of ROM image which is read before executing any tests,
23*0d6140beSAndroid Build Coastguard Worker        and restored unconditionally after execution of tests.
24*0d6140beSAndroid Build Coastguard Worker
25*0d6140beSAndroid Build Coastguard WorkerSyntax:
26*0d6140beSAndroid Build Coastguard WorkerENV_VARS="blah" ./do_tests.sh <test1> <test2>
27*0d6140beSAndroid Build Coastguard Worker
28*0d6140beSAndroid Build Coastguard WorkerExample:
29*0d6140beSAndroid Build Coastguard WorkerFLASHROM="../flashrom" FLASHROM_PARAM="-p internal:bus=spi" ./do_tests foo.sh bar.sh
30*0d6140beSAndroid Build Coastguard Worker
31*0d6140beSAndroid Build Coastguard WorkerEach unit test might have its own special requirements, such as extra
32*0d6140beSAndroid Build Coastguard Workerenvironment variables, layout files, etc. Please read the comments at the top
33*0d6140beSAndroid Build Coastguard Workerof each unit test to ensure there are no special dependencies.
34