aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Moyer <jmoyer@redhat.com>2020-02-20 15:06:30 -0500
committerEryu Guan <guaneryu@gmail.com>2020-03-06 15:55:39 +0800
commitfc7b3903894a6213c765d64df91847f4460336a2 (patch)
tree09d1c230dcc4fdb736ec943b89177a0022a90770
parent48045df9a851d96a58c70ff25d6d07447c34051c (diff)
downloadxfstests-dev-fc7b3903894a6213c765d64df91847f4460336a2.tar.gz
dax/dm: disable testing on devices that don't support dax
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>
-rw-r--r--common/dmdelay5
-rw-r--r--common/dmerror5
-rw-r--r--common/dmflakey5
-rw-r--r--common/dmthin5
-rw-r--r--common/rc11
5 files changed, 11 insertions, 20 deletions
diff --git a/common/dmdelay b/common/dmdelay
index f1e725b94..66cac1a70 100644
--- a/common/dmdelay
+++ b/common/dmdelay
@@ -7,11 +7,6 @@
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`
diff --git a/common/dmerror b/common/dmerror
index 426f1e96d..7d12e0a18 100644
--- a/common/dmerror
+++ b/common/dmerror
@@ -4,11 +4,6 @@
#
# 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
diff --git a/common/dmflakey b/common/dmflakey
index 2af3924d4..b4e11ae9c 100644
--- a/common/dmflakey
+++ b/common/dmflakey
@@ -8,11 +8,6 @@ FLAKEY_ALLOW_WRITES=0
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`
diff --git a/common/dmthin b/common/dmthin
index 7946e9a7c..61dd6f891 100644
--- a/common/dmthin
+++ b/common/dmthin
@@ -21,11 +21,6 @@ DMTHIN_POOL_DEV="/dev/mapper/$DMTHIN_POOL_NAME"
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
diff --git a/common/rc b/common/rc
index 0306e93cb..454f5ccf5 100644
--- a/common/rc
+++ b/common/rc
@@ -1874,6 +1874,17 @@ _require_dm_target()
_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