]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfstests: add _require_sparse_files
authorChristoph Hellwig <hch@lst.de>
Tue, 9 Nov 2010 13:53:36 +0000 (14:53 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 9 Nov 2010 13:53:36 +0000 (14:53 +0100)
Add a helper to check if the filesystem supports sparse files.  This is
used to guard tests that exercise sparse file functionality and would
take forever on filesystems that have to zero all blocks on extending
truncates.

Unfortunately there's no good way to autodetect this functionality, so
just implement it as a blacklist for now.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
014
129
130
239
240
common.rc

diff --git a/014 b/014
index a2be25a83662dcb465bad53ee216829a31f218f7..a0c040317e797c82323b5fd4834e01d5cd2c6ae4 100755 (executable)
--- a/014
+++ b/014
@@ -47,6 +47,7 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
+_require_sparse_files
 _setup_testdir
 
 echo "brevity is wit..."
diff --git a/129 b/129
index c9f11d6445ebfc6062e979b13cfd82528b4307d6..38f12a6ec044e96419add83232458029d6d0903f 100755 (executable)
--- a/129
+++ b/129
@@ -52,8 +52,10 @@ echo_and_run()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
+_require_sparse_files
+
+_setup_testdir
 
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount "-o nosuid"
diff --git a/130 b/130
index 21582ea43368770025188b57f708912f9c6ff785..ea5270dcdd1cdda6b655b0f4d67192f1247d1202 100755 (executable)
--- a/130
+++ b/130
@@ -55,8 +55,10 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
+_require_sparse_files
+
+_setup_testdir
 
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
diff --git a/239 b/239
index 1e3489fadbfbcd61b963c9c3ccecb8407b3be747..88ff776a8abc247d547516eaeb894d864f3f70a3 100755 (executable)
--- a/239
+++ b/239
@@ -45,6 +45,8 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
+_require_sparse_files
+
 AIO_TEST=src/aio-dio-regress/aio-dio-hole-filling-race
 [ -x $AIO_TEST ] || _notrun "$AIO_TEST not built"
 
diff --git a/240 b/240
index 67e458a3392e77a0d0c07d5f7aebe820d97598e4..05485361fbbfe03bf48a29a35a8f0f7ae23c8453 100755 (executable)
--- a/240
+++ b/240
@@ -48,6 +48,8 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
+_require_sparse_files
+
 echo "Silence is golden."
 
 # real QA test starts here
index b3bb65c6c808d6e93518c1dfe85b240e4a62741f..760b883eb24078ec3bf57a390968e7b71f9ce72e 100644 (file)
--- a/common.rc
+++ b/common.rc
@@ -857,6 +857,22 @@ _require_fs_space()
                _notrun "This test requires at least ${GB}GB free on $MNT to run"
 }
 
+#
+# Check if the filesystem supports sparse files.
+#
+# Unfortunately there is no better way to do this than a manual black list.
+#
+_require_sparse_files()
+{
+    case $FSTYP in
+    hfsplus)
+        _notrun "Sparse files not supported by this filesystem type: $FSTYP"
+       ;;
+    *)
+        ;;
+    esac
+}
+
 # check that a FS on a device is mounted
 # if so, return mount point
 #