"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/align-test" between
cryptsetup-2.3.6.tar.xz and cryptsetup-2.4.0.tar.xz

About: cryptsetup is a utility used to conveniently setup disk encryption based on the dm-crypt kernel module. These include plain dm-crypt volumes, LUKS volumes, loop-AES and TrueCrypt compatible format.

align-test  (cryptsetup-2.3.6.tar.xz):align-test  (cryptsetup-2.4.0.tar.xz)
skipping to change at line 23 skipping to change at line 23
cleanup() { cleanup() {
udevadm settle >/dev/null 2>&1 udevadm settle >/dev/null 2>&1
if [ -d "$MNT_DIR" ] ; then if [ -d "$MNT_DIR" ] ; then
umount -f $MNT_DIR 2>/dev/null umount -f $MNT_DIR 2>/dev/null
rmdir $MNT_DIR 2>/dev/null rmdir $MNT_DIR 2>/dev/null
fi fi
[ -b /dev/mapper/$DEV_STACKED ] && dmsetup remove --retry $DEV_STACKED >/ dev/null 2>&1 [ -b /dev/mapper/$DEV_STACKED ] && dmsetup remove --retry $DEV_STACKED >/ dev/null 2>&1
[ -b /dev/mapper/$DEV_NAME ] && dmsetup remove --retry $DEV_NAME >/dev/nu ll 2>&1 [ -b /dev/mapper/$DEV_NAME ] && dmsetup remove --retry $DEV_NAME >/dev/nu ll 2>&1
# FIXME scsi_debug sometimes in-use here # FIXME scsi_debug sometimes in-use here
sleep 1 sleep 1
rmmod scsi_debug 2>/dev/null rmmod scsi_debug >/dev/null 2>&1
sleep 1 sleep 1
} }
fail() fail()
{ {
if [ -n "$1" ] ; then echo "FAIL $1" ; fi if [ -n "$1" ] ; then echo "FAIL $1" ; fi
echo "FAILED backtrace:" echo "FAILED backtrace:"
while caller $frame; do ((frame++)); done while caller $frame; do ((frame++)); done
cleanup cleanup
exit 100 exit 100
} }
skip() skip()
{ {
echo "TEST SKIPPED: $1" echo "TEST SKIPPED: $1"
cleanup cleanup
exit 0 exit 77
} }
function dm_crypt_features() function dm_crypt_features()
{ {
VER_STR=$(dmsetup targets | grep crypt | cut -f2 -dv) VER_STR=$(dmsetup targets | grep crypt | cut -f2 -dv)
[ -z "$VER_STR" ] && fail "Failed to parse dm-crypt version." [ -z "$VER_STR" ] && fail "Failed to parse dm-crypt version."
VER_MAJ=$(echo $VER_STR | cut -f 1 -d.) VER_MAJ=$(echo $VER_STR | cut -f 1 -d.)
VER_MIN=$(echo $VER_STR | cut -f 2 -d.) VER_MIN=$(echo $VER_STR | cut -f 2 -d.)
VER_PTC=$(echo $VER_STR | cut -f 3 -d.) VER_PTC=$(echo $VER_STR | cut -f 3 -d.)
skipping to change at line 67 skipping to change at line 67
} }
[ $VER_MIN -lt 14 ] && return [ $VER_MIN -lt 14 ] && return
DM_PERF_CPU=1 DM_PERF_CPU=1
if [ $VER_MIN -ge 17 -o \( $VER_MIN -eq 14 -a $VER_PTC -ge 5 \) ]; then if [ $VER_MIN -ge 17 -o \( $VER_MIN -eq 14 -a $VER_PTC -ge 5 \) ]; then
DM_SECTOR_SIZE=1 DM_SECTOR_SIZE=1
fi fi
} }
add_device() { add_device() {
modprobe scsi_debug $@ delay=0 modprobe scsi_debug $@ delay=0 >/dev/null 2>&1
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
echo "This kernel seems to not support proper scsi_debug module, test skipped." echo "This kernel seems to not support proper scsi_debug module, test skipped."
exit 77 exit 77
fi fi
sleep 2 sleep 2
DEV=$(grep -l -e scsi_debug /sys/block/*/device/model | cut -f4 -d /) DEV=$(grep -l -e scsi_debug /sys/block/*/device/model | cut -f4 -d /)
if [ ! -e /sys/block/$DEV/alignment_offset ] ; then if [ ! -e /sys/block/$DEV/alignment_offset ] ; then
echo "This kernel seems to not support topology info, test skippe d." echo "This kernel seems to not support topology info, test skippe d."
skipping to change at line 182 skipping to change at line 182
echo "N/A" echo "N/A"
fi fi
} }
if [ $(id -u) != 0 ]; then if [ $(id -u) != 0 ]; then
echo "WARNING: You must be root to run this test, test skipped." echo "WARNING: You must be root to run this test, test skipped."
exit 77 exit 77
fi fi
dm_crypt_features dm_crypt_features
modprobe --dry-run scsi_debug || exit 77 modprobe --dry-run scsi_debug >/dev/null 2>&1 || skip "This kernel seems to not support proper scsi_debug module, test skipped."
cleanup cleanup
if [ -d /sys/module/scsi_debug ] ; then
echo "Cannot use scsi_debug module (in use or compiled-in), test skipped.
"
exit 77
fi
echo "# Create desktop-class 4K drive" echo "# Create desktop-class 4K drive"
echo "# (logical_block_size=512, physical_block_size=4096, alignment_offset=0)" echo "# (logical_block_size=512, physical_block_size=4096, alignment_offset=0)"
add_device dev_size_mb=16 sector_size=512 physblk_exp=3 num_tgts=1 add_device dev_size_mb=16 sector_size=512 physblk_exp=3 num_tgts=1
format 256 4096 format 256 4096
format 256 2056 8 format 256 2056 8
format 128 2048 format 128 2048
format 128 1032 8 format 128 1032 8
format 256 8192 8192 format 256 8192 8192
format 128 8192 8192 format 128 8192 8192
skipping to change at line 312 skipping to change at line 316
format_null 512 4040 8 format_null 512 4040 8
format_null 512 4096 128 format_null 512 4096 128
format_null 512 4096 2048 format_null 512 4096 2048
cleanup cleanup
echo "# Create enterprise-class 4K drive with fs and LUKS images." echo "# Create enterprise-class 4K drive with fs and LUKS images."
# loop device here presents 512 block but images have 4k block # loop device here presents 512 block but images have 4k block
# 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 "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 || skip "Mounting image is not available."
echo $PWD1 | $CRYPTSETUP luksFormat --type luks1 --key-size 256 $FAST_PBKDF echo $PWD1 | $CRYPTSETUP luksFormat --type luks1 --key-size 256 $FAST_PBK
$MNT_DIR/luks.img || fail DF $MNT_DIR/luks.img || fail
echo $PWD2 | $CRYPTSETUP luksFormat --type luks1 --key-size 256 $FAST_PBKDF echo $PWD2 | $CRYPTSETUP luksFormat --type luks1 --key-size 256 $FAST_PBK
$MNT_DIR/luks.img --header $MNT_DIR/luks_header.img || fail DF $MNT_DIR/luks.img --header $MNT_DIR/luks_header.img || fail
umount $MNT_DIR umount $MNT_DIR
done done
cleanup cleanup
 End of changes. 6 change blocks. 
13 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)