test generators: unify checksum check functions

This commit is contained in:
Milan Broz
2022-04-09 16:57:36 +02:00
parent 6d8587c137
commit c07cfa20de
20 changed files with 51 additions and 53 deletions

View File

@@ -47,10 +47,9 @@ function generate()
function check()
{
lib_hdr1_killed || exit 2
lib_hdr0_checksum || exit 2
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
chks_res0=$(read_sha256_checksum $TGT_IMG)
test "$chks0" = "$chks_res0" || exit 2
read -r json_str_res0 < $TMPDIR/json_res0
test ${#json_str_res0} -eq $((LUKS2_JSON_SIZE*512)) || exit 2
}