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

Tao Ma tao.ma at oracle.com
Mon Sep 8 19:48:20 PDT 2008


looks good.
one more thing, could you please separate xattr test from this patch?
I think you can add it after xattr is added into ocfs2-tools.

Regards,
Tao

Tristan Ye wrote:
> Create new testcases for mkfs-tests,to verfiy if all implemented features(like inline-data,xattr and sparse)
> were supported by mkfs.ocfs2 well.
> 
> Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
> ---
>  programs/mkfs-tests/mkfs-test.sh |   79 ++++++++++++++++++++++++++++++++++++++
>  1 files changed, 79 insertions(+), 0 deletions(-)
> 
> diff --git a/programs/mkfs-tests/mkfs-test.sh b/programs/mkfs-tests/mkfs-test.sh
> index 5b53ab4..4d3507e 100755
> --- a/programs/mkfs-tests/mkfs-test.sh
> +++ b/programs/mkfs-tests/mkfs-test.sh
> @@ -432,6 +432,85 @@ 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 option '--fs-features=xattr'
> +TAG=mkfs_test_${testnum}
> +OUT=${outdir}/${TAG}.log
> +if [ -f ${OUT} ]; then
> +        rm -f ${OUT};
> +fi;
> +echo "Test ${testnum}: --fs-features=xattr"
> +label="Oracle_Home"
> +echo -n "mkfs ..... "
> +${MKFS} --fs-features=xattr -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 "Xattr"
> +RC=$?
> +if [ "${RC}" != "0" ]; then
> +    echo "ERROR: Did not find Xattr 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



More information about the Ocfs2-tools-devel mailing list