From 847ff667ce673f553ef777593b70c2beb2032e15 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 29 Aug 2017 16:35:01 +0200 Subject: [PATCH] btrfs-progs: tests: add more checks for tools used in convert tests Tools that may not be present in common installations should be checked in the tests. Signed-off-by: David Sterba --- tests/convert-tests.sh | 4 ++++ tests/convert-tests/001-ext2-basic/test.sh | 1 + tests/convert-tests/002-ext3-basic/test.sh | 1 + tests/convert-tests/003-ext4-basic/test.sh | 1 + tests/convert-tests/005-delete-all-rollback/test.sh | 1 + tests/convert-tests/006-large-hole-extent/test.sh | 1 + tests/convert-tests/007-unsupported-block-sizes/test.sh | 1 + tests/convert-tests/008-readonly-image/test.sh | 1 + tests/convert-tests/009-common-inode-flags/test.sh | 3 +++ tests/convert-tests/010-reiserfs-basic/test.sh | 1 + tests/convert-tests/011-reiserfs-delete-all-rollback/test.sh | 1 + tests/convert-tests/012-reiserfs-large-hole-extent/test.sh | 1 + tests/convert-tests/013-reiserfs-common-inode-flags/test.sh | 3 +++ tests/convert-tests/014-reiserfs-tail-handling/test.sh | 2 ++ 14 files changed, 22 insertions(+) diff --git a/tests/convert-tests.sh b/tests/convert-tests.sh index c5663367..42479df9 100755 --- a/tests/convert-tests.sh +++ b/tests/convert-tests.sh @@ -22,6 +22,10 @@ export TEST_DEV rm -f "$RESULTS" check_kernel_support +# anything expected by common.convert +check_global_prereq getfacl +check_global_prereq setfacl +check_global_prereq md5sum run_one_test() { local testdir diff --git a/tests/convert-tests/001-ext2-basic/test.sh b/tests/convert-tests/001-ext2-basic/test.sh index 7d8e87d8..d94bf0b6 100755 --- a/tests/convert-tests/001-ext2-basic/test.sh +++ b/tests/convert-tests/001-ext2-basic/test.sh @@ -6,6 +6,7 @@ source "$TOP/tests/common.convert" setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert +check_global_prereq mke2fs for feature in '' 'extref' 'skinny-metadata' 'no-holes'; do convert_test ext2 "$feature" "ext2 4k nodesize" 4096 mke2fs -b 4096 diff --git a/tests/convert-tests/002-ext3-basic/test.sh b/tests/convert-tests/002-ext3-basic/test.sh index 5a33c2ca..f00e0e82 100755 --- a/tests/convert-tests/002-ext3-basic/test.sh +++ b/tests/convert-tests/002-ext3-basic/test.sh @@ -6,6 +6,7 @@ source "$TOP/tests/common.convert" setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert +check_global_prereq mke2fs for feature in '' 'extref' 'skinny-metadata' 'no-holes'; do convert_test ext3 "$feature" "ext3 4k nodesize" 4096 mke2fs -j -b 4096 diff --git a/tests/convert-tests/003-ext4-basic/test.sh b/tests/convert-tests/003-ext4-basic/test.sh index df8bec28..d33f1d9a 100755 --- a/tests/convert-tests/003-ext4-basic/test.sh +++ b/tests/convert-tests/003-ext4-basic/test.sh @@ -6,6 +6,7 @@ source "$TOP/tests/common.convert" setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert +check_global_prereq mke2fs for feature in '' 'extref' 'skinny-metadata' 'no-holes'; do convert_test ext4 "$feature" "ext4 4k nodesize" 4096 mke2fs -t ext4 -b 4096 diff --git a/tests/convert-tests/005-delete-all-rollback/test.sh b/tests/convert-tests/005-delete-all-rollback/test.sh index 337413bb..316d57a0 100755 --- a/tests/convert-tests/005-delete-all-rollback/test.sh +++ b/tests/convert-tests/005-delete-all-rollback/test.sh @@ -8,6 +8,7 @@ source "$TOP/tests/common.convert" setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert +check_global_prereq mke2fs # simple wrapper for a convert test # $1: btrfs features, argument to -O diff --git a/tests/convert-tests/006-large-hole-extent/test.sh b/tests/convert-tests/006-large-hole-extent/test.sh index f63a1186..0edb6280 100755 --- a/tests/convert-tests/006-large-hole-extent/test.sh +++ b/tests/convert-tests/006-large-hole-extent/test.sh @@ -11,6 +11,7 @@ source "$TOP/tests/common.convert" setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert +check_global_prereq mke2fs default_mke2fs="mke2fs -t ext4 -b 4096" convert_test_preamble '' 'large hole extent test' 16k "$default_mke2fs" diff --git a/tests/convert-tests/007-unsupported-block-sizes/test.sh b/tests/convert-tests/007-unsupported-block-sizes/test.sh index af8ec357..f1b29726 100755 --- a/tests/convert-tests/007-unsupported-block-sizes/test.sh +++ b/tests/convert-tests/007-unsupported-block-sizes/test.sh @@ -7,6 +7,7 @@ source "$TOP/tests/common.convert" setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert +check_global_prereq mke2fs for bs in 1024 2048; do default_mke2fs="mke2fs -t ext4 -b $bs" diff --git a/tests/convert-tests/008-readonly-image/test.sh b/tests/convert-tests/008-readonly-image/test.sh index dd954181..73c9eff2 100755 --- a/tests/convert-tests/008-readonly-image/test.sh +++ b/tests/convert-tests/008-readonly-image/test.sh @@ -7,6 +7,7 @@ source "$TOP/tests/common.convert" setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert +check_global_prereq mke2fs default_mke2fs="mke2fs -t ext4 -b 4096" convert_test_preamble '' 'readonly image test' 16k "$default_mke2fs" diff --git a/tests/convert-tests/009-common-inode-flags/test.sh b/tests/convert-tests/009-common-inode-flags/test.sh index f42fb681..1f3106b4 100755 --- a/tests/convert-tests/009-common-inode-flags/test.sh +++ b/tests/convert-tests/009-common-inode-flags/test.sh @@ -7,6 +7,9 @@ source "$TOP/tests/common.convert" setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert +check_global_prereq mke2fs +check_global_prereq lsattr +check_global_prereq chattr fail=0 default_mke2fs="mke2fs -t ext4 -b 4096" diff --git a/tests/convert-tests/010-reiserfs-basic/test.sh b/tests/convert-tests/010-reiserfs-basic/test.sh index f469aff2..32e15deb 100755 --- a/tests/convert-tests/010-reiserfs-basic/test.sh +++ b/tests/convert-tests/010-reiserfs-basic/test.sh @@ -6,6 +6,7 @@ source "$TOP/tests/common.convert" setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert +check_global_prereq mkreiserfs for feature in '' 'extref' 'skinny-metadata' 'no-holes'; do convert_test reiserfs "$feature" "reiserfs 4k nodesize" 4096 mkreiserfs -b 4096 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 b905db89..8c1b8057 100755 --- a/tests/convert-tests/011-reiserfs-delete-all-rollback/test.sh +++ b/tests/convert-tests/011-reiserfs-delete-all-rollback/test.sh @@ -7,6 +7,7 @@ source "$TOP/tests/common.convert" setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert +check_global_prereq mkreiserfs # simple wrapper for a convert test # $1: btrfs features, argument to -O 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 19acbbd1..d9abbd8a 100755 --- a/tests/convert-tests/012-reiserfs-large-hole-extent/test.sh +++ b/tests/convert-tests/012-reiserfs-large-hole-extent/test.sh @@ -11,6 +11,7 @@ source "$TOP/tests/common.convert" setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert +check_global_prereq mkreiserfs default_mkfs="mkreiserfs -b 4096" convert_test_preamble '' 'large hole extent test' 16k "$default_mkfs" 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 850ecb9a..ba160262 100755 --- a/tests/convert-tests/013-reiserfs-common-inode-flags/test.sh +++ b/tests/convert-tests/013-reiserfs-common-inode-flags/test.sh @@ -7,6 +7,9 @@ source "$TOP/tests/common.convert" setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert +check_global_prereq mkreiserfs +check_global_prereq chattr +check_global_prereq lsattr fail=0 default_mkfs="mkreiserfs -b 4096" diff --git a/tests/convert-tests/014-reiserfs-tail-handling/test.sh b/tests/convert-tests/014-reiserfs-tail-handling/test.sh index 58cfaa4b..aba5337b 100755 --- a/tests/convert-tests/014-reiserfs-tail-handling/test.sh +++ b/tests/convert-tests/014-reiserfs-tail-handling/test.sh @@ -13,6 +13,8 @@ setup_root_helper prepare_test_dev 512M check_prereq btrfs-convert check_global_prereq md5sum +check_global_prereq mkreiserfs +check_global_prereq perl perl -e "print 'a'x8192;" > input perl -e "print 'b'x8192;" > input2