mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-16 17:56:51 +00:00
btrfs-progs: tests: Add check for dm targets
This function will be used later to test if dm-thin is supported. Suggested-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
d028b3998e
commit
4e02678c29
14
tests/common
14
tests/common
@ -328,6 +328,20 @@ check_global_prereq()
|
||||
fi
|
||||
}
|
||||
|
||||
# Check if the targets passed as arguments are available, and if not just skip
|
||||
# the test
|
||||
check_dm_target_support()
|
||||
{
|
||||
setup_root_helper
|
||||
for target in "$@"; do
|
||||
$SUDO_HELPER modprobe "dm-$target" >/dev/null 2>&1
|
||||
$SUDO_HELPER dmsetup targets 2>&1 | grep -q "^$target"
|
||||
if [ $? -ne 0 ]; then
|
||||
_not_run "This test requires dm-$target support"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
check_image()
|
||||
{
|
||||
local image
|
||||
|
Loading…
Reference in New Issue
Block a user