Add xfs V5 image to tests.

XFS V4 can be disabled in kernel, add image V5.

Minimal 300M xfs size avoided by using QA variables magic in format:
export TEST_DIR=1 TEST_DEV=1 QA_CHECK_FS=1 ; mkfs -t xfs ...
This commit is contained in:
Milan Broz
2024-03-06 17:25:30 +01:00
parent 8819194281
commit dc669a14d3
5 changed files with 27 additions and 12 deletions

View File

@@ -338,12 +338,19 @@ echo "# Create enterprise-class 4K drive with fs and LUKS images."
# cryptsetup should properly use 4k block on direct-io
add_device dev_size_mb=32 sector_size=4096 physblk_exp=0 num_tgts=1 opt_blks=64
for file in $(ls img_fs_*.img.xz) ; do
echo "Format using fs image $file."
echo -n "Format using fs image $file "
xz -d -c $file | dd of=$DEV bs=1M 2>/dev/null || fail "bad image"
[ ! -d $MNT_DIR ] && mkdir $MNT_DIR
mount $DEV $MNT_DIR || skip "Mounting image is not available."
mount $DEV $MNT_DIR 2>/dev/null
if [ $? -ne 0 ] ; then
echo "[N/A]"
continue
fi
echo $PWD1 | $CRYPTSETUP luksFormat --type luks1 --key-size 256 $FAST_PBKDF $MNT_DIR/luks.img || fail
echo $PWD2 | $CRYPTSETUP luksFormat --type luks1 --key-size 256 $FAST_PBKDF $MNT_DIR/luks.img --header $MNT_DIR/luks_header.img || fail
umount $MNT_DIR
umount $MNT_DIR || fail
echo "[OK]"
done
cleanup
exit 0

View File

@@ -421,13 +421,18 @@ echo "# Create enterprise-class 4K drive with fs and LUKS images."
# cryptsetup should properly use 4k block on direct-io
add_device dev_size_mb=32 sector_size=4096 physblk_exp=0 num_tgts=1 opt_blks=64
for file in $(ls img_fs_*.img.xz) ; do
echo "Format using fs image $file."
echo -n "Format using fs image $file. "
xz -d -c $file | dd of=$DEV bs=1M 2>/dev/null || fail "bad image"
[ ! -d $MNT_DIR ] && mkdir $MNT_DIR
mount $DEV $MNT_DIR || skip "Mounting image is not available."
mount $DEV $MNT_DIR 2>/dev/null
if [ $? -ne 0 ] ; then
echo "[N/A]"
continue
fi
echo $PWD1 | $CRYPTSETUP luksFormat $FAST_PBKDF --type luks2 $MNT_DIR/luks.img --offset 8192 || fail
echo $PWD2 | $CRYPTSETUP luksFormat $FAST_PBKDF --type luks2 $MNT_DIR/luks.img --header $MNT_DIR/luks_header.img || fail
umount $MNT_DIR
umount $MNT_DIR || fail
echo "[OK]"
done
cleanup
@@ -454,3 +459,5 @@ add_device dev_size_mb=32 sector_size=4096 num_tgts=1 opt_blks=64
auto_sector 4096 $DEV
auto_sector 4096 $DEV $HDR
cleanup
exit 0

View File

@@ -80,12 +80,12 @@ falloc() {
run_all_in_fs() {
for file in $(ls img_fs_*.img.xz) ; do
echo "Run tests in $file put on top block device."
echo -n "Run tests in $file put on top block device. "
xz -d -c $file | dd of=$DEV bs=1M 2>/dev/null || fail "bad image"
[ ! -d $MNT_DIR ] && mkdir $MNT_DIR
mount $DEV $MNT_DIR
mount $DEV $MNT_DIR 2>/dev/null
if [ $? -ne 0 ]; then
echo "Mounting image $file failed, skipped."
echo "[N/A]"
continue;
fi
rm -rf $MNT_DIR/* 2>/dev/null
@@ -97,7 +97,8 @@ run_all_in_fs() {
BSIZE=$iobsize
run_all $tfile
BSIZE=$oldbsize
umount $MNT_DIR
umount $MNT_DIR || fail
echo "[OK]"
done
}

BIN
tests/img_fs_xfs5.img.xz Normal file

Binary file not shown.

View File

@@ -214,7 +214,7 @@ function simple_scsi_reenc()
function mount_and_test() {
test -d $MNT_DIR || mkdir -p $MNT_DIR
mount $@ $MNT_DIR 2>/dev/null || {
echo -n "failed to mount [SKIP]"
echo -n "[N/A]"
return 0
}
rm $MNT_DIR/* 2>/dev/null
@@ -242,7 +242,7 @@ function test_logging() {
echo -n "$1:"
for img in $(ls img_fs*img.xz) ; do
wipefs -a $SCSI_DEV > /dev/null
echo -n "[${img%.img.xz}]"
echo -n " [${img%.img.xz}]"
xz -d -c $img | dd of=$SCSI_DEV bs=4k >/dev/null 2>&1
mount_and_test $SCSI_DEV || return 1
done