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>
rm -f $RESULTS
check_prereq btrfs
rm -f $RESULTS
check_prereq btrfs
# The tests are driven by their custom script called 'test.sh'
# The tests are driven by their custom script called 'test.sh'
run_check $SUDO_HELPER 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()
{
TEST_MNT="${TEST_MNT:-$TOP/tests/mnt}"
export TEST_MNT
mkdir -p "$TEST_MNT" || { echo "Failed mkdir -p $TEST_MNT"; exit 1; }
run_one_test() {
local testdir
local testname
run_one_test() {
local testdir
local testname
check_prereq btrfs-corrupt-block
check_prereq btrfs-image
check_prereq btrfs
check_prereq btrfs-corrupt-block
check_prereq btrfs-image
check_prereq btrfs
run_one_test() {
local testname
run_one_test() {
local testname
check_prereq btrfs-image
check_prereq btrfstune
check_prereq btrfs
check_prereq btrfs-image
check_prereq btrfstune
check_prereq btrfs
# The tests are driven by their custom script called 'test.sh'
# The tests are driven by their custom script called 'test.sh'
check_prereq mkfs.btrfs
check_prereq btrfs
check_prereq mkfs.btrfs
check_prereq btrfs
# The tests are driven by their custom script called 'test.sh'
# The tests are driven by their custom script called 'test.sh'