mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 00:10:04 +01:00
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:
@@ -338,12 +338,19 @@ echo "# Create enterprise-class 4K drive with fs and LUKS images."
|
|||||||
# cryptsetup should properly use 4k block on direct-io
|
# 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
|
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
|
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"
|
xz -d -c $file | dd of=$DEV bs=1M 2>/dev/null || fail "bad image"
|
||||||
[ ! -d $MNT_DIR ] && mkdir $MNT_DIR
|
[ ! -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 $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
|
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
|
done
|
||||||
cleanup
|
cleanup
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|||||||
@@ -421,13 +421,18 @@ echo "# Create enterprise-class 4K drive with fs and LUKS images."
|
|||||||
# cryptsetup should properly use 4k block on direct-io
|
# 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
|
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
|
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"
|
xz -d -c $file | dd of=$DEV bs=1M 2>/dev/null || fail "bad image"
|
||||||
[ ! -d $MNT_DIR ] && mkdir $MNT_DIR
|
[ ! -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 $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
|
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
|
done
|
||||||
cleanup
|
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
|
||||||
auto_sector 4096 $DEV $HDR
|
auto_sector 4096 $DEV $HDR
|
||||||
cleanup
|
cleanup
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|||||||
@@ -80,12 +80,12 @@ falloc() {
|
|||||||
|
|
||||||
run_all_in_fs() {
|
run_all_in_fs() {
|
||||||
for file in $(ls img_fs_*.img.xz) ; do
|
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"
|
xz -d -c $file | dd of=$DEV bs=1M 2>/dev/null || fail "bad image"
|
||||||
[ ! -d $MNT_DIR ] && mkdir $MNT_DIR
|
[ ! -d $MNT_DIR ] && mkdir $MNT_DIR
|
||||||
mount $DEV $MNT_DIR
|
mount $DEV $MNT_DIR 2>/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Mounting image $file failed, skipped."
|
echo "[N/A]"
|
||||||
continue;
|
continue;
|
||||||
fi
|
fi
|
||||||
rm -rf $MNT_DIR/* 2>/dev/null
|
rm -rf $MNT_DIR/* 2>/dev/null
|
||||||
@@ -97,7 +97,8 @@ run_all_in_fs() {
|
|||||||
BSIZE=$iobsize
|
BSIZE=$iobsize
|
||||||
run_all $tfile
|
run_all $tfile
|
||||||
BSIZE=$oldbsize
|
BSIZE=$oldbsize
|
||||||
umount $MNT_DIR
|
umount $MNT_DIR || fail
|
||||||
|
echo "[OK]"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
tests/img_fs_xfs5.img.xz
Normal file
BIN
tests/img_fs_xfs5.img.xz
Normal file
Binary file not shown.
@@ -214,7 +214,7 @@ function simple_scsi_reenc()
|
|||||||
function mount_and_test() {
|
function mount_and_test() {
|
||||||
test -d $MNT_DIR || mkdir -p $MNT_DIR
|
test -d $MNT_DIR || mkdir -p $MNT_DIR
|
||||||
mount $@ $MNT_DIR 2>/dev/null || {
|
mount $@ $MNT_DIR 2>/dev/null || {
|
||||||
echo -n "failed to mount [SKIP]"
|
echo -n "[N/A]"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
rm $MNT_DIR/* 2>/dev/null
|
rm $MNT_DIR/* 2>/dev/null
|
||||||
@@ -242,7 +242,7 @@ function test_logging() {
|
|||||||
echo -n "$1:"
|
echo -n "$1:"
|
||||||
for img in $(ls img_fs*img.xz) ; do
|
for img in $(ls img_fs*img.xz) ; do
|
||||||
wipefs -a $SCSI_DEV > /dev/null
|
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
|
xz -d -c $img | dd of=$SCSI_DEV bs=4k >/dev/null 2>&1
|
||||||
mount_and_test $SCSI_DEV || return 1
|
mount_and_test $SCSI_DEV || return 1
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user