test/py: rewrite sqfsload command test suite
authorJoao Marcos Costa <jmcosta944@gmail.com>
Wed, 30 Jun 2021 22:45:04 +0000 (19:45 -0300)
committerTom Rini <trini@konsulko.com>
Mon, 5 Jul 2021 19:29:10 +0000 (15:29 -0400)
commit208eb2a4dcd37c0bb1b76b9d71f7bf28b85a899f
tree6f325ab40ce1c09216a217682755b4b928766d68
parent04c9813e951ffa9391daec5a8dcda90539ca2989
test/py: rewrite sqfsload command test suite

The previous strategy to know if a file was correctly loaded was to
check for how many bytes were read and compare it against the file's
original size. Since this is not a good solution, replace it by
comparing the checksum of the loaded bytes against the original file's
checksum. Add more test cases: files at a sub-directory and non-existent
file.

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org> [on sandbox]
Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com>
test/py/tests/test_fs/test_squashfs/test_sqfs_load.py