CRYPTSETUP="../src/cryptsetup"
DEV=""
+fail()
+{
+ [ -n "$1" ] && echo "$1"
+ exit 100
+}
+
add_device() {
modprobe scsi_debug $@
- DEV=/dev/$(grep scsi_debug /sys/block/*/device/model | cut -f4 -d /)
sleep 2
- [ -b $DEV ] || exit 100
+ DEV=/dev/$(grep scsi_debug /sys/block/*/device/model | cut -f4 -d /)
+ [ -b $DEV ] || fail "Cannot find $DEV."
}
cleanup() {
if [ $ALIGN -ne $2 ] ; then
echo "FAIL"
echo "Expected alignment differs: expected $2 != detected $ALIGN"
- exit 100
+ fail
fi
echo "PASSED"
}