mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-01 18:31:38 +00:00
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>
This commit is contained in:
parent
dbf16fe5e4
commit
4ad7a967d1
@ -20,6 +20,7 @@ export TEST_DEV
|
||||
rm -f $RESULTS
|
||||
|
||||
check_prereq btrfs
|
||||
check_kernel_support
|
||||
|
||||
# The tests are driven by their custom script called 'test.sh'
|
||||
|
||||
|
10
tests/common
10
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
|
||||
|
@ -21,6 +21,8 @@ export TEST_DEV
|
||||
|
||||
rm -f $RESULTS
|
||||
|
||||
check_kernel_support
|
||||
|
||||
run_one_test() {
|
||||
local testdir
|
||||
local testname
|
||||
|
@ -23,6 +23,7 @@ rm -f $RESULTS
|
||||
check_prereq btrfs-corrupt-block
|
||||
check_prereq btrfs-image
|
||||
check_prereq btrfs
|
||||
check_kernel_support
|
||||
|
||||
run_one_test() {
|
||||
local testname
|
||||
|
@ -24,6 +24,7 @@ check_prereq btrfs-corrupt-block
|
||||
check_prereq btrfs-image
|
||||
check_prereq btrfstune
|
||||
check_prereq btrfs
|
||||
check_kernel_support
|
||||
|
||||
# The tests are driven by their custom script called 'test.sh'
|
||||
|
||||
|
@ -21,6 +21,7 @@ rm -f $RESULTS
|
||||
|
||||
check_prereq mkfs.btrfs
|
||||
check_prereq btrfs
|
||||
check_kernel_support
|
||||
|
||||
# The tests are driven by their custom script called 'test.sh'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user