]> git.dujemihanovic.xyz Git - u-boot.git/commit
test/py: Check hashes produced by mkimage against known values
authorAlexandru Gagniuc <mr.nuke.me@gmail.com>
Wed, 15 Sep 2021 19:33:01 +0000 (14:33 -0500)
committerTom Rini <trini@konsulko.com>
Tue, 5 Oct 2021 12:50:15 +0000 (08:50 -0400)
commit01e1e2a966e282524f01ab14a5ceac793973cf28
tree6835b4dcdd9ef0dcb8fc3e416fc7a11901dad614
parent8a47982ed8d40595a83b82b2298753873e597708
test/py: Check hashes produced by mkimage against known values

Target code and mkimage share the same hashing infrastructure. If one
is wrong, it's very likely that both are wrong in the same way. Thus
testing won't catch hash regressions. This already happened in
commit 92055e138f28 ("image: Drop if/elseif hash selection in
calculate_hash()"). None of the tests caught that CRC32 was broken.

Instead of testing hash_calculate() against itself, create a FIT with
containing a kernel with pre-calculated hashes. Then check the hashes
produced against the known good hashes.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
test/py/tests/test_fit_hashes.py [new file with mode: 0644]
test/py/tests/vboot/hash-images.its [new file with mode: 0644]