summaryrefslogtreecommitdiff
path: root/tests/cp/sparse-fiemap
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2011-02-13 18:56:10 +0000
committerPádraig Brady <P@draigBrady.com>2011-02-15 00:02:29 +0000
commit0f56019db8d5a58e87adb61c7aab411113daf3c0 (patch)
treea31c2ed9bc790c0f641be63c8f77c1de39e9ceb7 /tests/cp/sparse-fiemap
parent275c831a3c4fd53638d4a1109cd266c359abc3c1 (diff)
downloadcoreutils-0f56019db8d5a58e87adb61c7aab411113daf3c0.tar.xz
tests: support more file systems in the cp fiemap tests
* tests/cp/sparse-fiemap: Check for fiemap support against a file rather than a directory to enable tests on BTRFS for example. Explicity disable the test on ext3 or file systems where we can't determine the type. * tests/cp/fiemap-perf: Likewise. Also disable the test on older BTRFS (like in Fedora 14), where extents are returned for holes. * tests/init.cfg: Comment that BTRFS only supports fiemap for regular files.
Diffstat (limited to 'tests/cp/sparse-fiemap')
-rwxr-xr-xtests/cp/sparse-fiemap9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/cp/sparse-fiemap b/tests/cp/sparse-fiemap
index fc27869e8..4eced1d69 100755
--- a/tests/cp/sparse-fiemap
+++ b/tests/cp/sparse-fiemap
@@ -19,10 +19,11 @@
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-# Note we don't check a file here as that could enable
-# the test on ext3 where this test is seen to fail.
-if fiemap_capable_ . ; then
- : # Current dir is on a partition with working extents. Good!
+# The test was seen to fail on ext3 so exclude that type
+# (or any file system where the type can't be determined)
+touch fiemap_chk
+if fiemap_capable_ fiemap_chk && ! df -t ext3 . >/dev/null; then
+ : # Current partition has working extents. Good!
else
# It's not; we need to create one, hence we need root access.
require_root_