diff options
author | Milan Broz <gmazyland@gmail.com> | 2024-03-06 17:25:30 +0100 |
---|---|---|
committer | Milan Broz <gmazyland@gmail.com> | 2024-03-07 11:30:21 +0000 |
commit | dc669a14d375c7ebecd816c48dd491989ebc2df0 (patch) | |
tree | bbe2e0cefe257c5332fb96f33104b41f99ce36cb | |
parent | 88191942817bf654e9f3b34d4e9f481db079db5f (diff) | |
download | cryptsetup-dc669a14d375c7ebecd816c48dd491989ebc2df0.tar.gz |
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 ...
-rwxr-xr-x | tests/align-test | 13 | ||||
-rwxr-xr-x | tests/align-test2 | 13 | ||||
-rwxr-xr-x | tests/blockwise-compat-test | 9 | ||||
-rw-r--r-- | tests/img_fs_xfs5.img.xz | bin | 0 -> 8380 bytes | |||
-rwxr-xr-x | tests/reencryption-compat-test | 4 |
5 files changed, 27 insertions, 12 deletions
diff --git a/tests/align-test b/tests/align-test index cc502a8f..0c1e02aa 100755 --- a/tests/align-test +++ b/tests/align-test @@ -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 diff --git a/tests/align-test2 b/tests/align-test2 index 23d418a8..6ed82bc9 100755 --- a/tests/align-test2 +++ b/tests/align-test2 @@ -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 diff --git a/tests/blockwise-compat-test b/tests/blockwise-compat-test index 8db91c9f..0672ca21 100755 --- a/tests/blockwise-compat-test +++ b/tests/blockwise-compat-test @@ -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 } diff --git a/tests/img_fs_xfs5.img.xz b/tests/img_fs_xfs5.img.xz Binary files differnew file mode 100644 index 00000000..26bd54c4 --- /dev/null +++ b/tests/img_fs_xfs5.img.xz diff --git a/tests/reencryption-compat-test b/tests/reencryption-compat-test index 8bab6052..7a6301e7 100755 --- a/tests/reencryption-compat-test +++ b/tests/reencryption-compat-test @@ -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 |