"Fossies" - the Fresh Open Source Software Archive  

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

blockwise-compat  (cryptsetup-2.3.6.tar.xz):blockwise-compat  (cryptsetup-2.4.0.tar.xz)
skipping to change at line 17 skipping to change at line 17
BW_UNIT=./unit-utils-io BW_UNIT=./unit-utils-io
STRACE=strace STRACE=strace
MNT_DIR=./mnt_bwunit MNT_DIR=./mnt_bwunit
LOCAL_FILE=./blockwise_localfile LOCAL_FILE=./blockwise_localfile
# $1 path to scsi debug bdev # $1 path to scsi debug bdev
scsi_debug_teardown() { scsi_debug_teardown() {
local _tries=15; local _tries=15;
while [ -b "$1" -a $_tries -gt 0 ]; do while [ -b "$1" -a $_tries -gt 0 ]; do
rmmod scsi_debug 2> /dev/null rmmod scsi_debug >/dev/null 2>&1
if [ -b "$1" ]; then if [ -b "$1" ]; then
sleep .1 sleep .1
_tries=$((_tries-1)) _tries=$((_tries-1))
fi fi
done done
test ! -b "$1" || rmmod scsi_debug test ! -b "$1" || rmmod scsi_debug >/dev/null 2>&1
} }
cleanup() { cleanup() {
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
rm -f $LOCAL_FILE 2> /dev/null rm -f $LOCAL_FILE 2> /dev/null
scsi_debug_teardown "$DEV" || exit 100 scsi_debug_teardown "$DEV" || exit 100
} }
skipping to change at line 63 skipping to change at line 63
} }
skip() skip()
{ {
echo "TEST SKIPPED: $1" echo "TEST SKIPPED: $1"
cleanup cleanup
exit 0 exit 0
} }
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
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."
} }
falloc() { falloc() {
skipping to change at line 119 skipping to change at line 124
local _fn=$1 local _fn=$1
shift shift
local _type="bdev" local _type="bdev"
local _fsize=0 local _fsize=0
test -b $_dev || { test -b $_dev || {
_type="file" _type="file"
_fsize=$(stat -c "%s" $_dev) _fsize=$(stat -c "%s" $_dev)
} }
case "$_res" in case "$_res" in
P) P)
MSG="Testing $_fn on $_type with params $@ [expecting TRUE]..." MSG="Testing $_fn on $_type with params $@ [expecting TRUE]..."
$BW_UNIT $_dev $_fn $@ $BW_UNIT $_dev $_fn $@
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
if [ $_type = "file" ]; then if [ $_type = "file" ]; then
warn_count warn_count
else else
fail_count fail_count
fi fi
trunc_file $_fsize $_dev trunc_file $_fsize $_dev
test -z "$STRACE" || $STRACE -o ./$BW_UNIT-fail-$FAILS-sh ould-pass.log $BW_UNIT $_dev $_fn $@ 2> /dev/null test -z "$STRACE" || $STRACE -o ./$BW_UNIT-fail-$FAILS-sh ould-pass.log $BW_UNIT $_dev $_fn $@ 2> /dev/null
else else
MSG="$MSG[OK]" MSG="$MSG[OK]"
fi fi
;; ;;
F) F)
MSG="Testing $_fn on $_type with params $@ [expecting FALSE]..." MSG="Testing $_fn on $_type with params $@ [expecting FALSE]..."
$BW_UNIT $_dev $_fn $@ 2> /dev/null $BW_UNIT $_dev $_fn $@ 2> /dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
if [ $_type = "file" ]; then if [ $_type = "file" ]; then
warn_count warn_count
else else
fail_count fail_count
fi fi
trunc_file $_fsize $_dev trunc_file $_fsize $_dev
test -z "$STRACE" || $STRACE -o ./$BW_UNIT-fail-$FAILS-sh ould-fail.log $BW_UNIT $_dev $_fn $@ 2> /dev/null test -z "$STRACE" || $STRACE -o ./$BW_UNIT-fail-$FAILS-sh ould-fail.log $BW_UNIT $_dev $_fn $@ 2> /dev/null
else else
MSG="$MSG[OK]" MSG="$MSG[OK]"
fi fi
;; ;;
*) *)
fail "Internal test error" fail "Internal test error"
;; ;;
esac esac
trunc_file $_fsize $_dev trunc_file $_fsize $_dev
} }
run_all() { run_all() {
if [ -b "$1" ]; then if [ -b "$1" ]; then
BD_FAIL="F" BD_FAIL="F"
else else
BD_FAIL="P" BD_FAIL="P"
fi fi
 End of changes. 6 change blocks. 
12 lines changed or deleted 18 lines changed or added

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