"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/discards-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.

discards-test  (cryptsetup-2.3.6.tar.xz):discards-test  (cryptsetup-2.4.0.tar.xz)
skipping to change at line 12 skipping to change at line 12
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".." [ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
DEV_NAME="discard-t3st" DEV_NAME="discard-t3st"
DEV="" DEV=""
PWD1="93R4P4pIqAH8" PWD1="93R4P4pIqAH8"
cleanup() { cleanup() {
[ -b /dev/mapper/$DEV_NAME ] && dmsetup remove --retry $DEV_NAME [ -b /dev/mapper/$DEV_NAME ] && dmsetup remove --retry $DEV_NAME
udevadm settle >/dev/null 2>&1 udevadm settle >/dev/null 2>&1
rmmod scsi_debug 2>/dev/null rmmod scsi_debug >/dev/null 2>&1
sleep 2 sleep 2
} }
fail() fail()
{ {
echo "FAILED backtrace:" echo "FAILED backtrace:"
while caller $frame; do ((frame++)); done while caller $frame; do ((frame++)); done
cleanup cleanup
exit 100 exit 100
} }
add_device() { add_device() {
modprobe scsi_debug $@ delay=0 rmmod scsi_debug >/dev/null 2>&1
if [ -d /sys/module/scsi_debug ] ; then
echo "Cannot use scsi_debug module (in use or compiled-in), test
skipped."
exit 77
fi
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 /)
DEV="/dev/$DEV" DEV="/dev/$DEV"
[ -b $DEV ] || fail "Cannot find $DEV." [ -b $DEV ] || fail "Cannot find $DEV."
skipping to change at line 57 skipping to change at line 62
test $VER_MAJ -gt 1 && return 0 test $VER_MAJ -gt 1 && return 0
test $VER_MIN -ge 11 && return 0 test $VER_MIN -ge 11 && return 0
return 1 return 1
} }
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
modprobe --dry-run scsi_debug || exit 77
modprobe dm-crypt >/dev/null 2>&1 modprobe dm-crypt >/dev/null 2>&1
if ! check_version ; then if ! check_version ; then
echo "Probably old kernel, test skipped." echo "Probably old kernel, test skipped."
exit 77 exit 77
fi fi
add_device dev_size_mb=16 sector_size=512 num_tgts=1 lbpu=1 add_device dev_size_mb=16 sector_size=512 num_tgts=1 lbpu=1
# FIXME test hash of device (unmap -> zero) # FIXME test hash of device (unmap -> zero)
# for now just check that flag is enabled # for now just check that flag is enabled
 End of changes. 3 change blocks. 
3 lines changed or deleted 8 lines changed or added

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