From 6fb88e28596a6fc8802640197428fd4c9244703b Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 7 Sep 2017 17:29:51 +0200 Subject: [PATCH] btrfs-progs: tests: check for kernel support for reiserfs Signed-off-by: David Sterba --- tests/common.convert | 14 ++++++++++++++ tests/convert-tests.sh | 1 + tests/convert-tests/010-reiserfs-basic/test.sh | 4 ++++ .../011-reiserfs-delete-all-rollback/test.sh | 4 ++++ .../012-reiserfs-large-hole-extent/test.sh | 4 ++++ .../013-reiserfs-common-inode-flags/test.sh | 4 ++++ .../014-reiserfs-tail-handling/test.sh | 4 ++++ 7 files changed, 35 insertions(+) diff --git a/tests/common.convert b/tests/common.convert index 7d9a5be1..1be804cf 100644 --- a/tests/common.convert +++ b/tests/common.convert @@ -275,3 +275,17 @@ convert_test() { convert_test_post_rollback "$fstype" } + +load_module_reiserfs() +{ + $SUDO_HELPER modprobe reiserfs +} + +check_kernel_support_reiserfs() +{ + if ! grep -iq 'reiserfs' /proc/filesystems; then + echo "WARNING: reiserfs filesystem not listed in /proc/filesystems, some tests might be skipped" + return 1 + fi + return 0 +} diff --git a/tests/convert-tests.sh b/tests/convert-tests.sh index 8e97b225..2a92a58b 100755 --- a/tests/convert-tests.sh +++ b/tests/convert-tests.sh @@ -22,6 +22,7 @@ export TEST_DEV rm -f "$RESULTS" check_kernel_support +check_kernel_support_reiserfs # anything expected by common.convert check_global_prereq getfacl check_global_prereq setfacl diff --git a/tests/convert-tests/010-reiserfs-basic/test.sh b/tests/convert-tests/010-reiserfs-basic/test.sh index 32e15deb..261f8704 100755 --- a/tests/convert-tests/010-reiserfs-basic/test.sh +++ b/tests/convert-tests/010-reiserfs-basic/test.sh @@ -3,6 +3,10 @@ source "$TOP/tests/common" source "$TOP/tests/common.convert" +if ! check_kernel_support_reiserfs >/dev/null; then + _not_run "no reiserfs support" +fi + setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert diff --git a/tests/convert-tests/011-reiserfs-delete-all-rollback/test.sh b/tests/convert-tests/011-reiserfs-delete-all-rollback/test.sh index 98dc5d69..c6c3119e 100755 --- a/tests/convert-tests/011-reiserfs-delete-all-rollback/test.sh +++ b/tests/convert-tests/011-reiserfs-delete-all-rollback/test.sh @@ -4,6 +4,10 @@ source "$TOP/tests/common" source "$TOP/tests/common.convert" +if ! check_kernel_support_reiserfs >/dev/null; then + _not_run "no reiserfs support" +fi + setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert diff --git a/tests/convert-tests/012-reiserfs-large-hole-extent/test.sh b/tests/convert-tests/012-reiserfs-large-hole-extent/test.sh index d9abbd8a..7a8d4972 100755 --- a/tests/convert-tests/012-reiserfs-large-hole-extent/test.sh +++ b/tests/convert-tests/012-reiserfs-large-hole-extent/test.sh @@ -8,6 +8,10 @@ source "$TOP/tests/common" source "$TOP/tests/common.convert" +if ! check_kernel_support_reiserfs >/dev/null; then + _not_run "no reiserfs support" +fi + setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert diff --git a/tests/convert-tests/013-reiserfs-common-inode-flags/test.sh b/tests/convert-tests/013-reiserfs-common-inode-flags/test.sh index d620a055..e242a3b0 100755 --- a/tests/convert-tests/013-reiserfs-common-inode-flags/test.sh +++ b/tests/convert-tests/013-reiserfs-common-inode-flags/test.sh @@ -4,6 +4,10 @@ source "$TOP/tests/common" source "$TOP/tests/common.convert" +if ! check_kernel_support_reiserfs >/dev/null; then + _not_run "no reiserfs support" +fi + setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert diff --git a/tests/convert-tests/014-reiserfs-tail-handling/test.sh b/tests/convert-tests/014-reiserfs-tail-handling/test.sh index aba5337b..f6131d96 100755 --- a/tests/convert-tests/014-reiserfs-tail-handling/test.sh +++ b/tests/convert-tests/014-reiserfs-tail-handling/test.sh @@ -9,6 +9,10 @@ source "$TOP/tests/common" source "$TOP/tests/common.convert" +if ! check_kernel_support_reiserfs >/dev/null; then + _not_run "no reiserfs support" +fi + setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert