Handle USE_RO_NORMAL preamble flag correctly.
USE_RO_NORMAL is a new preamble flag available in preamble header version 2.1.
When this flag is presented, it notices bootstub firmware to boot its RO normal
path instead of loading and verifying the RW firmware body.
So this CL is to fix some behaviors of existing tests in SAFT correctly.
- test_image_re_sign in test_flashrom_handler.py:
It increses the original firmware version 1 and resign it. The fix is to
pass the original preamble flags to the new one.
- test_image_corrupt_restore in test_flashrom_handler.py:
It corrupts the firmware body and expects an assertion. When USE_RO_NORMAL
presented, should expects no assertion as no firmware body verification.
This CL is not intended to test the usages of USE_RO_NORMAL. It is just for
fixing the original behaviors. A special USE_RO_NORMAL test will come later
for this purpose.
BUG=chromium-os:19451
TEST=manual
Ran saft on an ARM device and firmware with USE_NO_NORMAL presented.
Ran the unittest test_flashrom_handler.py succeeded.
localhost / # /usr/sbin/firmware/saft/runtests.sh
32768+0 records in
32768+0 records out
16777216 bytes (17 MB) copied, 0.623775 s, 26.9 MB/s
32768+0 records in
32768+0 records out
16777216 bytes (17 MB) copied, 0.926702 s, 18.1 MB/s
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.01432 s, 0.1 kB/s
starting as /tmp/tmp_saft.LntH/usr/sbin/firmware/saft/runtests.sh
......
----------------------------------------------------------------------
Ran 6 tests in 0.181s
OK
....
----------------------------------------------------------------------
Ran 4 tests in 19.150s
OK
Change-Id: I531ae8f6689ec87809d9d20c4b576062a7ca50f6
Reviewed-on: http://gerrit.chromium.org/gerrit/6464
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
4 files changed