Move the check for dax from the individual target scripts into
_require_dm_target. This fixes up a couple of missed tests that are
failing due to the lack of dax support (such as tests requiring
dm-snapshot).
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
DELAY_NONE=0
DELAY_READ=1
-echo $MOUNT_OPTIONS | grep -q dax
-if [ $? -eq 0 ]; then
- _notrun "Cannot run tests with DAX on dmdelay devices"
-fi
-
_init_delay()
{
local BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
#
# common functions for setting up and tearing down a dmerror device
-echo $MOUNT_OPTIONS | grep -q dax
-if [ $? -eq 0 ]; then
- _notrun "Cannot run tests with DAX on dmerror devices"
-fi
-
_dmerror_setup()
{
local dm_backing_dev=$SCRATCH_DEV
FLAKEY_DROP_WRITES=1
FLAKEY_ERROR_WRITES=2
-echo $MOUNT_OPTIONS | grep -q dax
-if [ $? -eq 0 ]; then
- _notrun "Cannot run tests with DAX on dmflakey devices"
-fi
-
_init_flakey()
{
local BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
DMTHIN_VOL_NAME="thin-vol"
DMTHIN_VOL_DEV="/dev/mapper/$DMTHIN_VOL_NAME"
-echo $MOUNT_OPTIONS | grep -q dax
-if [ $? -eq 0 ]; then
- _notrun "Cannot run tests with DAX on dmthin devices"
-fi
-
_dmthin_cleanup()
{
$UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
_require_sane_bdev_flush $SCRATCH_DEV
_require_command "$DMSETUP_PROG" dmsetup
+ echo $MOUNT_OPTIONS | grep -q dax
+ if [ $? -eq 0 ]; then
+ case $target in
+ stripe|linear|log-writes)
+ ;;
+ *)
+ _notrun "Cannot run tests with DAX on $target devices."
+ ;;
+ esac
+ fi
+
modprobe dm-$target >/dev/null 2>&1
$DMSETUP_PROG targets 2>&1 | grep -q ^$target