summaryrefslogtreecommitdiff
path: root/tests/common
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-11-10 18:57:38 +0100
committerDavid Sterba <dsterba@suse.com>2016-11-11 16:25:18 +0100
commit4ad7a967d1bcbb77b12b610b9db3ee07518ddb83 (patch)
treef37cd95b825458d7592cdaf6e61b995f7e5e4ebd /tests/common
parentdbf16fe5e4317e432525b5d3a36d31e77e4c5a5a (diff)
btrfs-progs: tests: check if kernel has btrfs support
Add some sanity checks, reported among other issues via bugzilla. References: https://bugzilla.kernel.org/show_bug.cgi?id=177141 Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/common b/tests/common
index 420286d6..c20fec88 100644
--- a/tests/common
+++ b/tests/common
@@ -280,10 +280,20 @@ run_check_umount_test_dev()
run_check $SUDO_HELPER umount "$@" "$TEST_DEV"
}
+check_kernel_support()
+{
+ if ! grep -iq 'btrfs' /proc/filesystems; then
+ echo "WARNING: btrfs filesystem not listed in /proc/filesystems, some tests might fail"
+ return 1
+ fi
+ return 0
+}
+
init_env()
{
TEST_MNT="${TEST_MNT:-$TOP/tests/mnt}"
export TEST_MNT
mkdir -p "$TEST_MNT" || { echo "Failed mkdir -p $TEST_MNT"; exit 1; }
+
}
init_env