iotests: Fix cluster size in parallels images tests (131)

In this test cluster size is 64k, but modern tools generate images with
cluster size 1M. Calculate cluster size using track field from image header.

Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Denis V. Lunev <den@openvz.org>
This commit is contained in:
Alexander Ivanov 2023-07-01 12:11:21 +02:00 committed by Denis V. Lunev
parent dbfc55606a
commit 8e10861b7d
2 changed files with 26 additions and 23 deletions

View file

@ -44,10 +44,13 @@ _supported_os Linux
inuse_offset=$((0x2c))
size=$((64 * 1024 * 1024))
CLUSTER_SIZE=$((64 * 1024))
IMGFMT=parallels
_make_test_img $size
# get cluster size in sectors from "tracks" header field
CLUSTER_SIZE_OFFSET=28
CLUSTER_SIZE=$(peek_file_le $TEST_IMG $CLUSTER_SIZE_OFFSET 4)
CLUSTER_SIZE=$((CLUSTER_SIZE * 512))
CLUSTER_HALF_SIZE=$((CLUSTER_SIZE / 2))
CLUSTER_DBL_SIZE=$((CLUSTER_SIZE * 2))