]> git.baikalelectronics.ru Git - uboot.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)
commit07b0267394f8c3f8756084569dc7634455c8e3b3
tree6835b4dcdd9ef0dcb8fc3e416fc7a11901dad614
parentce8c83bc15efabc66ae85db77534818d715e8db9
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 1affd3abbe04 ("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]