generic/085 was failing on a machine w/o devicemapper kernel
support because it requires the linear target, but didn't
explicitly test for it.
I could have cut & pasted _require_dm_linear(), but chose
to go the route of a generic helper, _require_dm_target $FOO,
because some day someone will need the zero target, the error
target, or who knows.
Add the helper, use it in test generic/085, and convert
_require_dm_flakey, _require_dm_snapshot, and
_dmerror_required with this new helper.
Reported-by: Angelo Dureghello <angelo.dureghello@nomovok.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
32 files changed:
#
# common functions for setting up and tearing down a dmerror device
#
# common functions for setting up and tearing down a dmerror device
-# this test requires the device mapper error target
-#
-_dmerror_required()
-{
- _require_command "$DMSETUP_PROG" dmsetup
-
- _require_block_device $SCRATCH_DEV
- _require_sane_bdev_flush $SCRATCH_DEV
-
- modprobe dm-mod >/dev/null 2>&1
- $DMSETUP_PROG targets | grep error >/dev/null 2>&1
- [ $? -ne 0 ] && _notrun "This test requires dm error support"
-}
-
_dmerror_init()
{
local dm_backing_dev=$SCRATCH_DEV
_dmerror_init()
{
local dm_backing_dev=$SCRATCH_DEV
-# this test requires the device mapper flakey target
-#
-_require_dm_flakey()
+# this test requires a specific device mapper target
+_require_dm_target()
# require SCRATCH_DEV to be a valid block device with sane BLKFLSBUF
# behaviour
_require_block_device $SCRATCH_DEV
_require_sane_bdev_flush $SCRATCH_DEV
_require_command "$DMSETUP_PROG" dmsetup
# require SCRATCH_DEV to be a valid block device with sane BLKFLSBUF
# behaviour
_require_block_device $SCRATCH_DEV
_require_sane_bdev_flush $SCRATCH_DEV
_require_command "$DMSETUP_PROG" dmsetup
- modprobe dm-flakey >/dev/null 2>&1
- $DMSETUP_PROG targets | grep flakey >/dev/null 2>&1
- if [ $? -ne 0 ]; then
- _notrun "This test requires dm flakey support"
- fi
-}
+ modprobe dm-$_target >/dev/null 2>&1
-_require_dm_snapshot()
-{
- _require_block_device $SCRATCH_DEV
- _require_sane_bdev_flush $SCRATCH_DEV
- _require_command "$DMSETUP_PROG" dmsetup
- modprobe dm-snapshot >/dev/null 2>&1
- $DMSETUP_PROG targets | grep -q snapshot
+ $DMSETUP_PROG targets 2>&1 | grep -q ^$_target
- _notrun "This test requires dm snapshot support"
+ _notrun "This test requires dm $_target support"
_supported_os Linux
_need_to_be_root
_require_scratch
_supported_os Linux
_need_to_be_root
_require_scratch
+_require_dm_target flakey
_require_cloner
_require_btrfs_fs_feature "no_holes"
_require_btrfs_mkfs_feature "no-holes"
_require_cloner
_require_btrfs_fs_feature "no_holes"
_require_btrfs_mkfs_feature "no-holes"
+_require_dm_target flakey
_need_to_be_root
rm -f $seqres.full
_need_to_be_root
rm -f $seqres.full
_supported_fs btrfs
_supported_os Linux
_require_scratch
_supported_fs btrfs
_supported_os Linux
_require_scratch
+_require_dm_target flakey
_need_to_be_root
BTRFS_DEBUG_TREE_PROG="`set_prog_path btrfs-debug-tree`"
_need_to_be_root
BTRFS_DEBUG_TREE_PROG="`set_prog_path btrfs-debug-tree`"
_supported_fs btrfs
_supported_os Linux
_require_scratch
_supported_fs btrfs
_supported_os Linux
_require_scratch
+_require_dm_target flakey
_require_cloner
_require_metadata_journaling $SCRATCH_DEV
_require_xfs_io_command "falloc"
_require_cloner
_require_metadata_journaling $SCRATCH_DEV
_require_xfs_io_command "falloc"
_supported_fs btrfs
_supported_os Linux
_require_scratch
_supported_fs btrfs
_supported_os Linux
_require_scratch
+_require_dm_target flakey
_require_cloner
_require_metadata_journaling $SCRATCH_DEV
_require_cloner
_require_metadata_journaling $SCRATCH_DEV
_supported_os Linux
_need_to_be_root
_require_scratch_dev_pool 3
_supported_os Linux
_need_to_be_root
_require_scratch_dev_pool 3
+_require_dm_target error
_need_to_be_root
_require_scratch_dev_pool 3
_require_btrfs_dev_del_by_devid
_need_to_be_root
_require_scratch_dev_pool 3
_require_btrfs_dev_del_by_devid
+_require_dm_target error
_supported_os Linux
_need_to_be_root
_require_scratch
_supported_os Linux
_need_to_be_root
_require_scratch
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_supported_os Linux
_need_to_be_root
_require_scratch
_supported_os Linux
_need_to_be_root
_require_scratch
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_supported_os Linux
_need_to_be_root
_require_scratch
_supported_os Linux
_need_to_be_root
_require_scratch
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_supported_os Linux
_need_to_be_root
_require_scratch
_supported_os Linux
_need_to_be_root
_require_scratch
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_supported_os Linux
_need_to_be_root
_require_scratch
_supported_os Linux
_need_to_be_root
_require_scratch
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_supported_os Linux
_need_to_be_root
_require_scratch
_supported_os Linux
_need_to_be_root
_require_scratch
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_supported_os Linux
_need_to_be_root
_require_scratch
_supported_os Linux
_need_to_be_root
_require_scratch
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
_require_xfs_io_command "fpunch"
_require_metadata_journaling $SCRATCH_DEV
_require_xfs_io_command "fpunch"
_supported_os Linux
_need_to_be_root
_require_scratch
_supported_os Linux
_need_to_be_root
_require_scratch
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_supported_os Linux
_need_to_be_root
_require_scratch
_supported_os Linux
_need_to_be_root
_require_scratch
+_require_dm_target flakey
_require_attrs
_require_metadata_journaling $SCRATCH_DEV
_require_attrs
_require_metadata_journaling $SCRATCH_DEV
_supported_os Linux
_need_to_be_root
_require_scratch
_supported_os Linux
_need_to_be_root
_require_scratch
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_supported_os Linux
_require_test
_require_scratch_nocheck
_supported_os Linux
_require_test
_require_scratch_nocheck
+_require_dm_target snapshot
_require_command $LVM_PROG lvm
echo "Silence is golden"
_require_command $LVM_PROG lvm
echo "Silence is golden"
+cleanup_dmdev()
+{
+ # in case it's still suspended and/or mounted
+ $DMSETUP_PROG resume $lvdev >/dev/null 2>&1
+ $UMOUNT_PROG $lvdev >/dev/null 2>&1
+
+ $DMSETUP_PROG remove $node >>$seqres.full 2>&1
+ $DMSETUP_PROG mknodes >/dev/null 2>&1
+}
+
# get standard environment, filters and checks
. ./common/rc
. ./common/filter
# get standard environment, filters and checks
. ./common/rc
. ./common/filter
_supported_os Linux
_require_scratch
_require_block_device $SCRATCH_DEV
_supported_os Linux
_require_scratch
_require_block_device $SCRATCH_DEV
-_require_command $DMSETUP_PROG
+_require_dm_target linear
_require_freeze
setup_dmdev()
_require_freeze
setup_dmdev()
-cleanup_dmdev()
-{
- # in case it's still suspended and/or mounted
- $DMSETUP_PROG resume $lvdev >/dev/null 2>&1
- $UMOUNT_PROG $lvdev >/dev/null 2>&1
-
- $DMSETUP_PROG remove $node >>$seqres.full 2>&1
- $DMSETUP_PROG mknodes >/dev/null 2>&1
-}
-
rm -f $seqres.full
echo "Silence is golden"
rm -f $seqres.full
echo "Silence is golden"
_supported_os Linux
_need_to_be_root
_require_scratch
_supported_os Linux
_need_to_be_root
_require_scratch
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_supported_fs generic
_supported_os Linux
_require_scratch
_supported_fs generic
_supported_os Linux
_require_scratch
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
# This test was motivated by an issue found in btrfs when the btrfs no-holes
_require_metadata_journaling $SCRATCH_DEV
# This test was motivated by an issue found in btrfs when the btrfs no-holes
_supported_fs generic
_supported_os Linux
_require_scratch
_supported_fs generic
_supported_os Linux
_require_scratch
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_supported_fs generic
_supported_os Linux
_require_scratch
_supported_fs generic
_supported_os Linux
_require_scratch
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_supported_fs generic
_supported_os Linux
_require_scratch
_supported_fs generic
_supported_os Linux
_require_scratch
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_supported_os Linux
_need_to_be_root
_require_scratch_nocheck
_supported_os Linux
_need_to_be_root
_require_scratch_nocheck
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
# xfs_io is not required for this test, but it's the best way to verify
_require_metadata_journaling $SCRATCH_DEV
# xfs_io is not required for this test, but it's the best way to verify
_supported_os Linux
_need_to_be_root
_require_scratch_nocheck
_supported_os Linux
_need_to_be_root
_require_scratch_nocheck
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_supported_os Linux
_need_to_be_root
_require_scratch_nocheck
_supported_os Linux
_need_to_be_root
_require_scratch_nocheck
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_supported_os Linux
_need_to_be_root
_require_scratch
_supported_os Linux
_need_to_be_root
_require_scratch
+_require_dm_target flakey
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_supported_os Linux
_need_to_be_root
_require_scratch
_supported_os Linux
_need_to_be_root
_require_scratch
+_require_dm_target flakey
_require_attrs
_require_metadata_journaling $SCRATCH_DEV
_require_attrs
_require_metadata_journaling $SCRATCH_DEV
_supported_os Linux
_require_scratch
_supported_os Linux
_require_scratch
+_require_dm_target flakey
_require_xfs_sysfs debug/log_recovery_delay
echo "Silence is golden."
_require_xfs_sysfs debug/log_recovery_delay
echo "Silence is golden."