mirror of
https://github.com/pengutronix/genimage.git
synced 2024-11-27 03:33:59 +08:00
test: add more sparse checks
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This commit is contained in:
parent
0ef795f3a6
commit
d51e814991
@ -67,15 +67,22 @@ test_expect_success rauc "rauc" "
|
||||
exec_test_set_prereq simg2img
|
||||
test_expect_success simg2img "android-sparse" "
|
||||
setup_test_images &&
|
||||
# make sure there is a 4*32k hole at the end
|
||||
i=16
|
||||
truncate --size=\$[i*(i+1)*i*i*512+32768*4] input/interleaved
|
||||
for i in \`seq 16\`; do
|
||||
dd if=/dev/urandom of=input/interleaved conv=notrunc seek=\$[i*i] count=\$[i] bs=\$[i*i*512] || break
|
||||
done &&
|
||||
dd if=/dev/urandom of=input/not-aligned count=9 bs=1024
|
||||
run_genimage sparse.config &&
|
||||
md5sum images/test.hdimage input/interleaved > md5sum &&
|
||||
rm images/test.hdimage input/interleaved &&
|
||||
check_size_range images/interleaved.sparse 9732464 9732608 &&
|
||||
# simg2img will expand the partial block
|
||||
truncate --size=12k input/not-aligned
|
||||
md5sum images/test.hdimage input/interleaved input/not-aligned > md5sum &&
|
||||
rm images/test.hdimage input/interleaved input/not-aligned &&
|
||||
check_size_range images/interleaved.sparse 9732464 9732636 &&
|
||||
simg2img images/test.sparse images/test.hdimage &&
|
||||
simg2img images/interleaved.sparse input/interleaved &&
|
||||
simg2img images/not-aligned.sparse input/not-aligned &&
|
||||
md5sum -c md5sum
|
||||
"
|
||||
|
||||
|
@ -30,3 +30,10 @@ image interleaved.sparse {
|
||||
block-size = 32k
|
||||
}
|
||||
}
|
||||
|
||||
image not-aligned.sparse {
|
||||
android-sparse {
|
||||
image = not-aligned
|
||||
block-size = 4k
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user