Skip to contentSkip to conversation

xfstests: add _require_sparse_files

PATCH In review Christoph Hellwig 2 participants 3 messages Oct 28, 2010 – Nov 9, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: add _require_sparse_files

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.

014 +1 -0
Index: xfstests-dev/014
===================================================================
@@ -47,6 +47,7 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
+_require_sparse_files
 _setup_testdir
 
 echo "brevity is wit..."
129 +3 -1
Index: xfstests-dev/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"
130 +3 -1
Index: xfstests-dev/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
240 +2 -0
Index: xfstests-dev/240
===================================================================
@@ -48,6 +48,8 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
+_require_sparse_files
+
 echo "Silence is golden."
 
 # real QA test starts here
common.rc +16 -0
Index: xfstests-dev/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 sparese 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
 #

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw

updated version to also include test 239 which reqires the check, too.

---
From: Christoph Hellwig <[email protected]>
Subject: [PATCH] xfstests: add _require_sparse_files

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.

014 +1 -0
Index: xfstests-dev/014
===================================================================
@@ -47,6 +47,7 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
+_require_sparse_files
 _setup_testdir
 
 echo "brevity is wit..."
129 +3 -1
Index: xfstests-dev/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"
130 +3 -1
Index: xfstests-dev/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
240 +2 -0
Index: xfstests-dev/240
===================================================================
@@ -48,6 +48,8 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
+_require_sparse_files
+
 echo "Silence is golden."
 
 # real QA test starts here
common.rc +16 -0
Index: xfstests-dev/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 sparese 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
 #
239 +2 -0
Index: xfstests-dev/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"
 

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by
#2 lore raw
Quoted 11 lines · Christoph Hellwig

updated version to also include test 239 which reqires the check, too.

---
From: Christoph Hellwig <[email protected]>
Subject: [PATCH] xfstests: add _require_sparse_files

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.

Quoted 4 lines

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

Looks ok, minor typo needs fixing, but:

common.rc _require_fs_space() · line 861

Quoted 2 lines
common.rc +2 -0
+#
+# Check if the filesystem supports sparese files.

sparse

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs