[Ocfs2-tools-devel] [PATCH 1/3] Ocfs2-tests: Add testcases for mkfs-tests to verify inline-data and sparse support for mkfs.ocfs2.v2

Tristan Ye tristan.ye at oracle.com
Mon Sep 8 23:31:42 PDT 2008


Create new testcases for mkfs-tests,to verfiy if all implemented features(like inline-data and sparse file)
were supported by mkfs.ocfs2 well.

Also add a check for ${OUT} in new testcases to make it compatible with the rest.Meanwhile,take xattr check from
former patch,will add until xattr supported by ocfs2-tools.

Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
---
 programs/mkfs-tests/mkfs-test.sh |   53 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/programs/mkfs-tests/mkfs-test.sh b/programs/mkfs-tests/mkfs-test.sh
index 5b53ab4..51d61be 100755
--- a/programs/mkfs-tests/mkfs-test.sh
+++ b/programs/mkfs-tests/mkfs-test.sh
@@ -432,6 +432,59 @@ fi
 do_fsck ${OUT}
 testnum=$[$testnum+1]
 
+
+### Test option '--fs-features=inline-data'
+TAG=mkfs_test_${testnum}
+OUT=${outdir}/${TAG}.log
+if [ -f ${OUT} ]; then
+        rm -f ${OUT};
+fi;
+echo "Test ${testnum}: --fs-features=inline-data"
+label="Oracle_Home"
+echo -n "mkfs ..... "
+${MKFS} --fs-features=inline-data -x -F -b 4K -C 4K -N 2 -L ${label} ${device} 262144 >>${OUT} 2>&1
+echo "OK"
+echo -n "verify ..... "
+${DEBUGFS} -R "stats" ${device} >>${OUT} 2>&1
+${DEBUGFS} -R "stats" ${device}|${GREP} -i "Feature Incompat"|${GREP} -q "InlineData"
+RC=$?
+if [ "${RC}" != "0" ]; then
+    echo "ERROR: Did not find InlineData Flag on superblock " >> ${OUT}
+    echo "" >> ${OUT}
+    echo "FAILED. Errors in ${OUT}"
+else
+    echo "OK"
+fi
+do_fsck ${OUT}
+testnum=$[$testnum+1]
+
+
+### Test default support for sparse file'
+TAG=mkfs_test_${testnum}
+OUT=${outdir}/${TAG}.log
+if [ -f ${OUT} ]; then
+        rm -f ${OUT};
+fi;
+echo "Test ${testnum}: Default option for sparse file support"
+label="Oracle_Home"
+echo -n "mkfs ..... "
+${MKFS} -x -F -b 4K -C 4K -N 2 -L ${label} ${device} 262144 >>${OUT} 2>&1
+echo "OK"
+echo -n "verify ..... "
+${DEBUGFS} -R "stats" ${device} >>${OUT} 2>&1
+${DEBUGFS} -R "stats" ${device}|${GREP} -i "Feature Incompat"|${GREP} -q "Sparse"
+RC=$?
+if [ "${RC}" != "0" ]; then
+    echo "ERROR: Did not find Sparse Flag on superblock " >> ${OUT}
+    echo "" >> ${OUT}
+    echo "FAILED. Errors in ${OUT}"
+else
+    echo "OK"
+fi
+do_fsck ${OUT}
+testnum=$[$testnum+1]
+
+
 ### Test bitmap_cpg change
 TAG=mkfs_test_${testnum}
 OUT=${outdir}/${TAG}.log
-- 
1.5.5




More information about the Ocfs2-tools-devel mailing list