]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common: introduce two pre-checkup routines for xfs crc specified testing
authorJie Liu <jeff.liu@oracle.com>
Mon, 20 Jan 2014 01:42:46 +0000 (12:42 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 20 Jan 2014 01:42:46 +0000 (12:42 +1100)
Introduce two pre-checkup routines _require_xfs_mkfs_crc as well
as _require_xfs_crc to verify if mkfs.xfs and kernel are have crc
feature or not.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/rc

index a585eb594ba755a63141253f232263517dbe884b..72ea9ebfee99987de90c2a0026577aa86181842d 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1132,6 +1132,23 @@ _require_projid32bit()
           || _notrun "mkfs.xfs doesn't have projid32bit feature"
 }
 
+# this test requires the crc feature to be available in mkfs.xfs
+#
+_require_xfs_mkfs_crc()
+{
+       _scratch_mkfs_xfs -f -m crc=1 >/dev/null 2>&1 \
+          || _notrun "mkfs.xfs doesn't have crc feature"
+}
+
+# this test requires the xfs kernel support crc feature
+#
+_require_xfs_crc()
+{
+       _scratch_mount >/dev/null 2>&1 \
+          || _notrun "Kernel doesn't support crc feature"
+       umount $SCRATCH_MNT
+}
+
 # this test requires that external log/realtime devices are not in use
 #
 _require_nonexternal()