Skip to content

Commit

Permalink
Add xfs V5 image to tests.
Browse files Browse the repository at this point in the history
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 ...
  • Loading branch information
mbroz committed Mar 7, 2024
1 parent d478e09 commit 2f0e804
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
13 changes: 10 additions & 3 deletions tests/align-test
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 10 additions & 3 deletions tests/align-test2
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
9 changes: 5 additions & 4 deletions tests/blockwise-compat-test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

Expand Down
Binary file added tests/img_fs_xfs5.img.xz
Binary file not shown.
4 changes: 2 additions & 2 deletions tests/reencryption-compat-test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2f0e804

Please sign in to comment.