[Ocfs2-test-devel] [PATCH 2/9] Single run: make blocksize and clustersize as parameters

Eric Ren zren at suse.com
Fri Jun 17 02:12:57 PDT 2016


It takes too long to get the result of a round testing. This
can shorten a lot time by eliminating 2-layer loops with blocksize
and clustersize. Now blocksize defaults to 4096, while clustersize
to 32768 if not specified.

Signed-off-by: Eric Ren <zren at suse.com>
---
 programs/backup_super/test_backup_super.sh |  91 +++++-----
 programs/inline-data/single-inline-run.sh  |  40 ++---
 programs/mkfs-tests/mkfs-test.sh           |  46 ++---
 programs/python_common/single_run-WIP.sh   | 260 +++++++++++++++--------------
 programs/reflink_tests/reflink_test_run.sh |  25 +--
 programs/tunefs-test/tunefs-test.sh        | 218 ++++++++++++------------
 programs/xattr_tests/xattr-single-run.sh   |  32 ++--
 7 files changed, 361 insertions(+), 351 deletions(-)

diff --git a/programs/backup_super/test_backup_super.sh b/programs/backup_super/test_backup_super.sh
index ed7c94b..5a8472c 100755
--- a/programs/backup_super/test_backup_super.sh
+++ b/programs/backup_super/test_backup_super.sh
@@ -49,6 +49,9 @@ LOGFILE=""
 FIRST_BACKUP_OFF=1073741824	#1G
 MAX_NUM=6
 
+blocksize=
+clustersize=
+
 #
 # usage			Display help information and exit.
 #
@@ -65,11 +68,13 @@ function usage()
 	      --with-mkfs=PROGRAM          use the PROGRAM as fswreck
 	      --with-debugfs=PROGRAM        use the PROGRAM as mkfs.ocfs2
 	      --with-tunefs=PROGRAM        use the PROGRAM as tunefs.ocfs2
+	      --block-size=blocksize       block size
+	      --cluster-size=clustersize   cluster size
 
 	Examples:
 
-	  $script --with-debugfs=../debugfs.ocfs2/debugfs.ocfs2 /dev/sde2
-	  $script --with-mkfs=/sbin/mkfs.ocfs2 --log-dir=/tmp /dev/sde2
+	  $script --with-debugfs=../debugfs.ocfs2/debugfs.ocfs2 --block-size=4096 --clustersize=32768 /dev/sde2
+	  $script --with-mkfs=/sbin/mkfs.ocfs2 --log-dir=/tmp --block-size=4096 --clustersize=32768 /dev/sde2
 	EOF
 }
 
@@ -376,54 +381,46 @@ function volume_small_test()
 ##################################
 function normal_test()
 {
-	for blocksize in 512 4096
+	vol_byte_size=$FIRST_BACKUP_OFF
+	#last_backup_num is set according to the vol_byte_size
+	#for 1 for 1G, and 2 for 4G, 3 for 16G etc.
+	last_backup_num=1
+
+	while [ `expr $vol_byte_size` -le `expr $byte_total` ] ;
 	do
-		for clustersize in \
-			4096 32768 1048576
-		do
+		echo "vol_size = $vol_byte_size, blocksize = $blocksize,"	\
+		     " clustersize = $clustersize" |tee -a ${LOGFILE}
 
-			vol_byte_size=$FIRST_BACKUP_OFF
-			#last_backup_num is set according to the vol_byte_size
-			#for 1 for 1G, and 2 for 4G, 3 for 16G etc.
-			last_backup_num=1
+		bpc=`expr $clustersize / $blocksize`
 
-			while [ `expr $vol_byte_size` -le `expr $byte_total` ] ;
-			do
-				echo "vol_size = $vol_byte_size, blocksize = $blocksize,"	\
-				     " clustersize = $clustersize" |tee -a ${LOGFILE}
+		test_mkfs
 
-				bpc=`expr $clustersize / $blocksize`
+		#for fsck, we must increase vol_byte_size to include
+		#the backup block.
+		blkcount=`expr $vol_byte_size / $blocksize + $bpc`
+		test_fsck
 
-				test_mkfs
+		#for resize, the initial blkcount should not include
+		#the backup block.
+		blkcount=`expr $vol_byte_size / $blocksize`
+		test_tunefs_resize
 
-				#for fsck, we must increase vol_byte_size to include
-				#the backup block.
-				blkcount=`expr $vol_byte_size / $blocksize + $bpc`
-				test_fsck
-	
-				#for resize, the initial blkcount should not include
-				#the backup block.
-				blkcount=`expr $vol_byte_size / $blocksize`
-				test_tunefs_resize
-	
-				#for add backup blocks, we must increase vol_byte_size
-				#to include the backup block.
-				blkcount=`expr $vol_byte_size / $blocksize + $bpc`
-				test_tunefs_add_backup
-	
-				#for refresh backup blocks, we must increase
-				#vol_byte_size to include the backup block.
-				blkcount=`expr $vol_byte_size / $blocksize + $bpc`
-				test_tunefs_refresh
-	
-			        vol_byte_size=`expr $vol_byte_size \* 4`
-				last_backup_num=`expr $last_backup_num + 1`
-	
-				if [ `expr $last_backup_num` -gt `expr $MAX_NUM` ]; then
-					break
-				fi
-			done
-		done
+		#for add backup blocks, we must increase vol_byte_size
+		#to include the backup block.
+		blkcount=`expr $vol_byte_size / $blocksize + $bpc`
+		test_tunefs_add_backup
+
+		#for refresh backup blocks, we must increase
+		#vol_byte_size to include the backup block.
+		blkcount=`expr $vol_byte_size / $blocksize + $bpc`
+		test_tunefs_refresh
+
+		vol_byte_size=`expr $vol_byte_size \* 4`
+		last_backup_num=`expr $last_backup_num + 1`
+
+		if [ `expr $last_backup_num` -gt `expr $MAX_NUM` ]; then
+			break
+		fi
 	done
 }
 
@@ -462,6 +459,12 @@ do
 	"--with-tunefs="*)
 		TUNEFS_BIN="${1#--with-tunefs=}"
 		;;
+	"--block-size="*)
+		blocksize="${1#--block-size=}"
+		;;
+	"--cluster-size="*)
+		clustersize="${1#--cluster-size=}"
+		;;
 	*)
 		DEVICE="$1"
 		;;
diff --git a/programs/inline-data/single-inline-run.sh b/programs/inline-data/single-inline-run.sh
index 938f461..1677981 100755
--- a/programs/inline-data/single-inline-run.sh
+++ b/programs/inline-data/single-inline-run.sh
@@ -105,8 +105,10 @@ exit_or_not()
 ################################################################################
 f_usage()
 {
-    echo "usage: `basename ${0}` [-o output] <-d <device>> <mountpoint path>"
+    echo "usage: `basename ${0}` [-o output] <-b blocksize> <-c clustersize> <-d <device>> <mountpoint path>"
     echo "       -o output directory for the logs"
+    echo "       -b blocksize"
+    echo "       -c clustersize"
     echo "       -d device name used for ocfs2 volume"
     echo "       <mountpoint path> path of mountpoint where the ocfs2 volume will be mounted on."
     exit 1;
@@ -120,10 +122,12 @@ f_getoptions()
                 exit 1
          fi
 
-         while getopts "o:hd:" options; do
+         while getopts "o:hd:b:c:" options; do
                 case $options in
                 o ) LOG_OUT_DIR="$OPTARG";;
                 d ) OCFS2_DEVICE="$OPTARG";;
+                b ) BLOCKSIZE="$OPTARG";;
+                c ) CLUSTERSIZE="$OPTARG";;
                 h ) f_usage
                     exit 1;;
                 * ) f_usage
@@ -132,13 +136,15 @@ f_getoptions()
         done
         shift $(($OPTIND -1))
         MOUNT_POINT=${1}
-
 }
 
 f_setup()
 {
         f_getoptions $*
 
+	BLOCKSIZE=${BLOCKSIZE:-4096}
+	CLUSTERSIZE=${CLUSTERSIZE:-32768}
+
         if [ -z "${MOUNT_POINT}" ];then
                 f_usage
 	else
@@ -373,22 +379,16 @@ trap ' : ' SIGTERM
 
 f_setup $*
 
-for BLOCKSIZE in 512 1024 4096
-do
-	for CLUSTERSIZE in 4096 32768 1048576
-	do
-		echo "++++++++++Single node inline-data test with \"-b ${BLOCKSIZE} -C ${CLUSTERSIZE}\"++++++++++" |tee -a ${RUN_LOG_FILE}
-		echo "++++++++++Single node inline-data test with \"-b ${BLOCKSIZE} -C ${CLUSTERSIZE}\"++++++++++">>${DATA_LOG_FILE}
-		echo "++++++++++Single node inline-data test with \"-b ${BLOCKSIZE} -C ${CLUSTERSIZE}\"++++++++++">>${DIRS_LOG_FILE}
-		echo "======================================================================================="
-		f_do_mkfs_and_mount
-		f_run_data_test
-		f_run_dirs_test
-		f_do_umount
-		echo "======================================================================================="
-		echo -e "\n\n\n">>${DATA_LOG_FILE}
-		echo -e "\n\n\n">>${DIRS_LOG_FILE}
-	done
-done
+echo "++++++++++Single node inline-data test with \"-b ${BLOCKSIZE} -C ${CLUSTERSIZE}\"++++++++++" |tee -a ${RUN_LOG_FILE}
+echo "++++++++++Single node inline-data test with \"-b ${BLOCKSIZE} -C ${CLUSTERSIZE}\"++++++++++">>${DATA_LOG_FILE}
+echo "++++++++++Single node inline-data test with \"-b ${BLOCKSIZE} -C ${CLUSTERSIZE}\"++++++++++">>${DIRS_LOG_FILE}
+echo "======================================================================================="
+f_do_mkfs_and_mount
+f_run_data_test
+f_run_dirs_test
+f_do_umount
+echo "======================================================================================="
+echo -e "\n\n\n">>${DATA_LOG_FILE}
+echo -e "\n\n\n">>${DIRS_LOG_FILE}
 
 f_cleanup
diff --git a/programs/mkfs-tests/mkfs-test.sh b/programs/mkfs-tests/mkfs-test.sh
index 3fc93a4..43ac5b9 100755
--- a/programs/mkfs-tests/mkfs-test.sh
+++ b/programs/mkfs-tests/mkfs-test.sh
@@ -1,12 +1,14 @@
 #!/bin/sh
 #
-# mkfs_test -o <outdir> -d <device>
+# mkfs_test -o <outdir> -d <device> -b <blocksize> -c <clustersize>
 #
 usage() {
-    echo "usage: ${MKFS_TEST} -o <outdir> -d <device> -m <mountpoint>"
+    echo "usage: ${MKFS_TEST} -o <outdir> -d <device> -m <mountpoint> -b <blocksize> -c <clustersize>"
     echo "       -o output directory for the logs"
     echo "       -d device"
     echo "       -m mountpoint"
+    echo "       -b blocksize"
+    echo "       -c clustersize"
     exit 1
 }
 
@@ -255,13 +257,17 @@ bindir=`basename ${0}`
 outdir=`basename ${bindir}`
 device=
 mntdir=
+blocksize=
+clustersize=
 OPTIND=1
-while getopts "d:i:o:m:c" args
+while getopts "d:i:o:m:c:b:" args
 do
   case "$args" in
     o) outdir="$OPTARG";;
     d) device="$OPTARG";;
     m) mntdir="$OPTARG";;
+    b) blocksize="$OPTARG";;
+    c) clustersize="$OPTARG";;
   esac
 done
 LOGFILE=${outdir}/mkfs-test.log
@@ -284,6 +290,11 @@ if [ -z "${mntdir}" ]; then
     usage ;
 fi
 
+if [ -z "${blocksize}" -o -z "${clustersize}" ]; then
+    echo "please specify blocksize and clustersize" |tee -a ${LOGFILE}
+    usage ;
+fi
+
 echo "create logdir ${outdir}" |tee -a ${LOGFILE}
 mkdir -p ${outdir}
 
@@ -296,26 +307,17 @@ numblks=1048576
 
 testnum=1
 
+TAG=mkfs_test_${testnum}
+OUT=${outdir}/${TAG}.log
+if [ -f ${OUT} ]; then
+	rm -f ${OUT};
+fi;
 
-### Test all combinations of blocksizes and clustersizes
-for blks in 512 1024 2048 4096
-do
-    for clusts in 4096 8192 16384 32768 65536 131072 262144 524288 1048576
-    do
-        TAG=mkfs_test_${testnum}
-        OUT=${outdir}/${TAG}.log
-	if [ -f ${OUT} ]; then
-		rm -f ${OUT};
-	fi;
-
-        echo "Test ${testnum}: -b ${blks} -C ${clusts}" |tee -a ${LOGFILE}
-        do_mkfs ${blks} ${clusts} ${device} ${numblks} ${OUT}
-        verify_sizes ${blks} ${clusts} ${numblks} ${OUT}
-        do_fsck ${OUT}
-        testnum=$[$testnum+1]
-    done
-done
-
+echo "Test ${testnum}: -b ${blocksize} -c ${clustersize}" |tee -a ${LOGFILE}
+do_mkfs ${blocksize} ${clustersize} ${device} ${numblks} ${OUT}
+verify_sizes ${blocksize} ${clustersize} ${numblks} ${OUT}
+do_fsck ${OUT}
+testnum=$[$testnum+1]
 
 ### Test option '-T mail'
 TAG=mkfs_test_${testnum}
diff --git a/programs/python_common/single_run-WIP.sh b/programs/python_common/single_run-WIP.sh
index 5a8fae1..87b18fc 100755
--- a/programs/python_common/single_run-WIP.sh
+++ b/programs/python_common/single_run-WIP.sh
@@ -197,7 +197,7 @@ do_mkdir() {
 run_create_and_open()
 {
 	log_message "run_create_and_open" $@
-        if [ "$#" -lt "3" ]; then
+        if [ "$#" -lt "5" ]; then
                 echo "Error in run_create_and_open()"
                 exit 1
         fi
@@ -205,10 +205,10 @@ run_create_and_open()
 	logdir=$1
 	device=$2
 	mountpoint=$3
+	blocksize=$4
+	clustersize=$5
 
 	workdir=${mountpoint}/create_and_open_test
-	blocksize=4096
-	clustersize=32768
 	features="sparse,unwritten,inline-data"
 
 	mountopts="defaults"
@@ -269,7 +269,7 @@ run_extend_and_write()
 run_directaio()
 {
 	log_message "run_directaio" $@
-        if [ "$#" -lt "3" ]; then
+        if [ "$#" -lt "5" ]; then
                 echo "Error in run_directaio()"
                 exit 1
         fi
@@ -277,10 +277,10 @@ run_directaio()
 	logdir=$1
 	device=$2
 	mountpoint=$3
+	blocksize=$4
+	clustersize=$5
 
 	workfile=${mountpoint}/directaio_testfile
-	blocksize=4096
-	clustersize=32768
 	features="sparse,unwritten,inline-data"
 
 	for mopt in writeback ordered
@@ -303,11 +303,11 @@ run_directaio()
 	done
 }
 
-# run_aiostress ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+# run_aiostress ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 run_aiostress()
 {
 	log_message "run_aiostress" $@
-        if [ "$#" -lt "3" ]; then
+        if [ "$#" -lt "5" ]; then
                 echo "Error in run_aiostress()"
                 exit 1
         fi
@@ -315,10 +315,10 @@ run_aiostress()
 	logdir=$1
 	device=$2
 	mountpoint=$3
+	blocksize=$4
+	clustersize=$5
 
 	workdir=${mountpoint}/testme
-	blocksize=4096
-	clustersize=8192
 	features="sparse,unwritten,inline-data"
 
 	for mopt in writeback ordered
@@ -347,11 +347,11 @@ run_aiostress()
 	done
 }
 
-# run_buildkernel ${LOGDIR} ${DEVICE} {MOUNTPOINT} ${KERNELSRC}
+# run_buildkernel ${LOGDIR} ${DEVICE} {MOUNTPOINT} ${KERNELSRC} ${BLOCKSIZE} ${CLUSTERSIZE}
 run_buildkernel()
 {
 	log_message "run_buildkernel" $@
-        if [ "$#" -lt "4" ]; then
+        if [ "$#" -lt "6" ]; then
                 echo "Error in run_buildkernel()"
                 exit 1
         fi
@@ -360,11 +360,11 @@ run_buildkernel()
 	device=$2
 	mountpoint=$3
 	kernelsrc=$4
+	blocksize=$5
+	clustersize=$6
 
 	node=`${HOSTNAME}`
 	workdir=${mountpoint}/testme
-	blocksize=4096
-	clustersize=4096
 	features="sparse,unwritten,inline-data"
 
 	for mopt in writeback ordered
@@ -392,11 +392,11 @@ run_buildkernel()
 	done
 }
 
-# run_filesizelimits ${LOGDIR} ${DEVICE} {MOUNTPOINT}
+# run_filesizelimits ${LOGDIR} ${DEVICE} {MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 run_filesizelimits()
 {
 	log_message "run_filesizelimits" $@
-        if [ "$#" -lt "3" ]; then
+        if [ "$#" -lt "5" ]; then
                 echo "Error in run_filesizelimits()"
                 exit 1
         fi
@@ -404,6 +404,7 @@ run_filesizelimits()
 	logdir=$1
 	device=$2
 	mountpoint=$3
+	blocksize=$4
 
 	mountopts=defaults
 	clustersize=4096
@@ -511,11 +512,11 @@ EOF
 	done
 }
 
-# run_mmaptruncate ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+# run_mmaptruncate ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 run_mmaptruncate()
 {
 	log_message "run_mmaptruncate" $@
-        if [ "$#" -lt "3" ]; then
+        if [ "$#" -lt "5" ]; then
                 echo "Error in run_mmaptruncate()"
                 exit 1
         fi
@@ -523,18 +524,18 @@ run_mmaptruncate()
 	logdir=$1
 	device=$2
 	mountpoint=$3
+	blocksize=$4
+	clustersize=$5
 
 	runtime=300
 	workfile=${mountpoint}/mmaptruncate.txt
 	varfile=${logdir}/mmaptruncate.conf
 
 	${CAT} > ${varfile} <<EOF
-2048	4096	nosparse,nounwritten,noinline-data	data=ordered
-2048	65536	sparse,unwritten,inline-data		data=writeback
-4096	4096	sparse,unwritten,inline-data		data=ordered
-4096	8192	nosparse,nounwritten,noinline-data	data=writeback
-4096	131072	sparse,unwritten,inline-data		data=ordered
-4096	1048576	sparse,unwritten,inline-data		data=writeback
+nosparse,nounwritten,noinline-data	data=ordered
+sparse,unwritten,inline-data		data=writeback
+sparse,unwritten,inline-data		data=ordered
+nosparse,nounwritten,noinline-data	data=writeback
 EOF
 	if [ $? != 0 ]; then
 		${ECHO} "ERROR writing ${varfile}"
@@ -543,10 +544,8 @@ EOF
 
 	${CAT} ${varfile} | while read LINE
 	do
-        	blocksize=`echo ${LINE} | cut -f1 -d' '`
-        	clustersize=`echo ${LINE} | cut -f2 -d' '`
-        	features=`echo ${LINE} | cut -f3 -d' '`
-		mountopts=`echo ${LINE} | cut -f4 -d' '`
+        	features=`echo ${LINE} | cut -f1 -d' '`
+		mountopts=`echo ${LINE} | cut -f2 -d' '`
 
 		get_bits $clustersize
 		clustersize_bits=$?
@@ -566,11 +565,11 @@ EOF
 	done
 }
 
-# run_renamewriterace ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+# run_renamewriterace ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 run_renamewriterace()
 {
 	log_message "run_renamewriterace" $@
-        if [ "$#" -lt "3" ]; then
+        if [ "$#" -lt "5" ]; then
                 echo "Error in run_renamewriterace()"
                 exit 1
         fi
@@ -578,10 +577,10 @@ run_renamewriterace()
 	logdir=$1
 	device=$2
 	mountpoint=$3
+	blocksize=$4
+	clustersize=$5
 
 	workdir=${mountpoint}/testme
-	blocksize=4096
-	clustersize=4096
 	features="sparse,unwritten,inline-data"
 
 	for mopt in writeback ordered
@@ -608,7 +607,7 @@ run_renamewriterace()
 run_splice()
 {
 	log_message "run_splice" $@
-        if [ "$#" -lt "3" ]; then
+        if [ "$#" -lt "5" ]; then
                 echo "Error in run_splice()"
                 exit 1
         fi
@@ -616,10 +615,10 @@ run_splice()
 	logdir=$1
 	device=$2
 	mountpoint=$3
+	blocksize=$4
+	clustersize=$5
 
 	workdir=${mountpoint}/testme
-	blocksize=4096
-	clustersize=32768
 	features="sparse,unwritten,inline-data"
 
 	for mopt in writeback ordered
@@ -646,7 +645,7 @@ run_splice()
 run_sendfile()
 {
 	log_message "run_sendfile" $@
-        if [ "$#" -lt "3" ]; then
+        if [ "$#" -lt "5" ]; then
                 echo "Error in run_sendfile()"
                 exit 1
         fi
@@ -654,12 +653,12 @@ run_sendfile()
 	logdir=$1
 	device=$2
 	mountpoint=$3
+	blocksize=$4
+	clustersize=$5
 
 	workfile=${mountpoint}/ocfs2_sendfile_data
 	verifyfile=/tmp/sendfile_verify
 	
-	blocksize=4096
-	clustersize=32768
 	features="sparse,unwritten,inline-data"
 	port=8001
 
@@ -697,7 +696,7 @@ run_sendfile()
 run_mmap()
 {
 	log_message "run_mmap" $@
-        if [ "$#" -lt "3" ]; then
+        if [ "$#" -lt "5" ]; then
                 echo "Error in run_mmap()"
                 exit 1
         fi
@@ -705,38 +704,36 @@ run_mmap()
 	logdir=$1
 	device=$2
 	mountpoint=$3
+	blocksize=$4
+	clustersize=$5
 
 	workfile=${mountpoint}/mmap_testfile
 	features="sparse,unwritten,inline-data"
 
-	for blocksize in 512 1024 2048 4096;do
-		for clustersize in 4096 32768 1048576;do
-			for mopt in writeback ordered;do
-				mountopts="data=${mopt}"
+	for mopt in writeback ordered;do
+	      mountopts="data=${mopt}"
 
-				log_start "mmap" ${blocksize} ${clustersize} ${features} ${mountopts}
+	      log_start "mmap" ${blocksize} ${clustersize} ${features} ${mountopts}
 
-				do_format ${blocksize} ${clustersize} ${features} ${device}
-				do_mount ${device} ${mountpoint} ${mountopts}
+	      do_format ${blocksize} ${clustersize} ${features} ${device}
+	      do_mount ${device} ${mountpoint} ${mountopts}
 
-				outlog=${logdir}/mmap_${mopt}_${blocksize}_${clustersize}.log
+	      outlog=${logdir}/mmap_${mopt}_${blocksize}_${clustersize}.log
 
-				dd if=/dev/zero of=${workfile} bs=1M count=1024
-				mmap_test ${workfile} >${outlog} 2>&1
-				RC=$?
+	      dd if=/dev/zero of=${workfile} bs=1M count=1024
+	      mmap_test ${workfile} >${outlog} 2>&1
+	      RC=$?
 
-				do_umount ${mountpoint}
+	      do_umount ${mountpoint}
 
-				log_end ${RC}
-			done
-		done
+	      log_end ${RC}
 	done
 }
 
 run_reserve_space()
 {
 	log_message "run_reserve_space" $@
-        if [ "$#" -lt "3" ]; then
+        if [ "$#" -lt "5" ]; then
                 echo "Error in run_reserve_space()"
                 exit 1
         fi
@@ -744,54 +741,52 @@ run_reserve_space()
 	logdir=$1
 	device=$2
 	mountpoint=$3
+	blocksize=$4
+	clustersize=$5
 
 	workfile=${mountpoint}/reserve_space_testfile
 	features="sparse,unwritten,inline-data"
 	space_free=
 	iter=1000
 
-	for blocksize in 512 1024 2048 4096;do
-		for clustersize in 4096 32768 1048576;do
-			for mopt in writeback ordered;do
-				mountopts="data=${mopt}"
-
-				log_start "reserve_space" ${blocksize} ${clustersize} ${features} ${mountopts}
-
-				do_format ${blocksize} ${clustersize} ${features} ${device}
-				do_mount ${device} ${mountpoint} ${mountopts}
-
-				outlog=${logdir}/reserve_space_${mopt}_${blocksize}_${clustersize}.log
-				space_free=`df|grep ${device}|awk '{print $4}'`
-				space_free=$((${space_free}*1024))
-
-				for i in `seq ${iter}`;do
-					r_whence=0
-					r_start=$((${RANDOM}%${space_free}))
-					r_len=$((${RANDOM}%(${space_free}-${r_start})))
-
-					reserve_space ${workfile} resv ${r_whence} ${r_start} ${r_len} >>${outlog} 2>&1 || {
-						RC=$?
-						break
-					}
-				
-					reserve_space ${workfile} unresv ${r_whence} ${r_start} ${r_len} >>${outlog} 2>&1 || {
-						RC=$?
-						break
-					}
-				done
-
-				do_umount ${mountpoint}
-
-				log_end ${RC}
-			done
-		done
+	for mopt in writeback ordered;do
+	    mountopts="data=${mopt}"
+
+	    log_start "reserve_space" ${blocksize} ${clustersize} ${features} ${mountopts}
+
+	    do_format ${blocksize} ${clustersize} ${features} ${device}
+	    do_mount ${device} ${mountpoint} ${mountopts}
+
+	    outlog=${logdir}/reserve_space_${mopt}_${blocksize}_${clustersize}.log
+	    space_free=`df|grep ${device}|awk '{print $4}'`
+	    space_free=$((${space_free}*1024))
+
+	    for i in `seq ${iter}`;do
+		    r_whence=0
+		    r_start=$((${RANDOM}%${space_free}))
+		    r_len=$((${RANDOM}%(${space_free}-${r_start})))
+
+		    reserve_space ${workfile} resv ${r_whence} ${r_start} ${r_len} >>${outlog} 2>&1 || {
+			    RC=$?
+			    break
+		    }
+	    
+		    reserve_space ${workfile} unresv ${r_whence} ${r_start} ${r_len} >>${outlog} 2>&1 || {
+			    RC=$?
+			    break
+		    }
+	    done
+
+	    do_umount ${mountpoint}
+
+	    log_end ${RC}
 	done
 }
 
 run_inline_data()
 {
 	log_message "run_inline_data" $@
-        if [ "$#" -lt "3" ]; then
+        if [ "$#" -lt "5" ]; then
                 echo "Error in run_inline_data()"
                 exit 1
         fi
@@ -799,9 +794,11 @@ run_inline_data()
 	logdir=$1
 	device=$2
 	mountpoint=$3
+	blocksize=$4
+	clustersize=$5
 
 	log_start "inline_data_test" 
-	single-inline-run.sh  -o ${logdir} -d ${device} ${mountpoint}
+	single-inline-run.sh  -o ${logdir} -d ${device} -b ${blocksize} -c ${clustersize} ${mountpoint}
 	RC=$?
 	log_end ${RC}
 }
@@ -809,7 +806,7 @@ run_inline_data()
 run_dx_dir()
 {
 	log_message "run_dx_dir" $@
-        if [ "$#" -lt "3" ]; then
+        if [ "$#" -lt "6" ]; then
                 echo "Error in run_dx_dir()"
                 exit 1
         fi
@@ -818,9 +815,11 @@ run_dx_dir()
 	device=$2
 	mountpoint=$3
         kernelsrc=$4
+	blocksize=$5
+	clustersize=$6
 
 	log_start "index_dir_test" 
-	index_dir_run.sh  -o ${logdir} -d ${device} -t ${kernelsrc} ${mountpoint}
+	index_dir_run.sh  -o ${logdir} -d ${device} -t ${kernelsrc} -b ${blocksize} -c ${clustersize} ${mountpoint}
 	RC=$?
 	log_end ${RC}
 }
@@ -828,7 +827,7 @@ run_dx_dir()
 run_xattr_test()
 {
 	log_message "run_xattr_test" $@
-        if [ "$#" -lt "3" ]; then
+        if [ "$#" -lt "5" ]; then
                 echo "Error in run_xattr_test()"
                 exit 1
         fi
@@ -836,9 +835,11 @@ run_xattr_test()
 	logdir=$1
 	device=$2
 	mountpoint=$3
+	blocksize=$4
+	clustersize=$5
 
 	log_start "xattr_test" 
-	xattr-single-run.sh -c -o ${logdir} -d ${device} ${mountpoint}
+	xattr-single-run.sh -c -o ${logdir} -d ${device} -b ${blocksize} -C ${clustersize} ${mountpoint}
 	RC=$?
 
 	log_end ${RC}
@@ -847,7 +848,7 @@ run_xattr_test()
 run_reflink_test()
 {
 	log_message "run_reflink_test" $@
-        if [ "$#" -lt "3" ]; then
+        if [ "$#" -lt "5" ]; then
                 echo "Error in run_reflink()"
                 exit 1
         fi
@@ -855,10 +856,12 @@ run_reflink_test()
 	logdir=$1
 	device=$2
 	mountpoint=$3
+	blocksize=$4
+	clustersize=$5
 
 	#ordered mount option
 	log_start "reflink_test" "ordered"
-	./reflink_test_run.sh -o ${logdir} -d ${device} ${mountpoint} || {
+	./reflink_test_run.sh -o ${logdir} -d ${device} -b ${blocksize} -c ${clustersize} ${mountpoint} || {
 		RC=$?
 		log_end ${RC}
 	}
@@ -894,7 +897,7 @@ run_filecheck_test()
 run_mkfs()
 {
 	log_message "run_mkfs" $@
-        if [ "$#" -lt "2" ]; then
+        if [ "$#" -lt "5" ]; then
                 echo "Error in run_mkfs()"
                 exit 1
         fi
@@ -902,9 +905,11 @@ run_mkfs()
 	logdir=$1
 	device=$2
 	mountpoint=$3
+	blocksize=$4
+	clustersize=$5
 
 	log_start "mkfs_test"
-	mkfs-test.sh -o ${logdir} -d ${device} -m ${mountpoint}
+	mkfs-test.sh -o ${logdir} -d ${device} -m ${mountpoint} -b ${blocksize} -c ${clustersize}
 	RC=$?
 	log_end ${RC}
 }
@@ -912,7 +917,7 @@ run_mkfs()
 run_tunefs()
 {
 	log_message "run_tunefs" $@
-        if [ "$#" -lt "2" ]; then
+        if [ "$#" -lt "5" ]; then
                 echo "Error in run_tunefs()"
                 exit 1
         fi
@@ -920,9 +925,11 @@ run_tunefs()
 	logdir=$1
 	device=$2
 	mountpoint=$3
+	blocksize=$4
+	clustersize=$5
 
 	log_start "tunefs_test"
-	tunefs-test.sh -o ${logdir} -d ${device} -m ${mountpoint}
+	tunefs-test.sh -o ${logdir} -d ${device} -m ${mountpoint} -b ${blocksize} -c ${clustersize}
 	RC=$?
 	log_end ${RC}
 }
@@ -930,16 +937,18 @@ run_tunefs()
 run_backup_super()
 {
 	log_message "run_backup_super" $@
-        if [ "$#" -lt "2" ]; then
+        if [ "$#" -lt "4" ]; then
                 echo "Error in run_backup_super()"
                 exit 1
         fi
 
 	logdir=$1
 	device=$2
+	blocksize=$3
+	clustersize=$4
 
 	log_start "backup_super_test"
-	test_backup_super.sh --log-dir=${logdir} ${device}
+	test_backup_super.sh --log-dir=${logdir} --block-size=${blocksize} --cluster-size=${clustersize} ${device}
 	RC=$?
 	log_end ${RC}
 }
@@ -952,11 +961,11 @@ run_backup_super()
 
 usage()
 {
-	${ECHO} "usage: ${APP} [-k kerneltarball] -m mountpoint -l logdir -d device [-t testcases]"
+	${ECHO} "usage: ${APP} [-k kerneltarball] -m mountpoint -l logdir -d device [-t testcases] [-b blocksize] [-c clustersize]"
 	exit 1
 }
 
-while getopts "d:m:k:l:t:h:?" args
+while getopts "d:m:k:l:t:b:c:h:?" args
 do
 	case "$args" in
 		d) DEVICE="$OPTARG";;
@@ -964,6 +973,8 @@ do
 		k) KERNELSRC="$OPTARG";;
 		l) OUTDIR="$OPTARG";;
 		t) TESTCASES="$OPTARG";;
+		b) BLOCKSIZE="$OPTARG";;
+		c) CLUSTERSIZE="$OPTARG";;
     		h) usage;;
     		?) usage;;
   	esac
@@ -994,6 +1005,9 @@ if [ -z ${TESTCASES} ]; then
 	TESTCASES="all"
 fi
 
+BLOCKSIZE=${BLOCKSIZE:-4096}
+CLUSTERSIZE=${CLUSTERSIZE:-32768}
+
 SUPPORTED_TESTCASES="all create_and_open directaio fillverifyholes renamewriterace aiostress\
   filesizelimits mmaptruncate buildkernel splice sendfile mmap reserve_space inline xattr\
   reflink mkfs tunefs backup_super filecheck"
@@ -1030,11 +1044,11 @@ ${ECHO} "Output log is ${LOGFILE}"
 for tc in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do
 
 	if [ "$tc"X = "create_and_open"X -o "$tc"X = "all"X ];then
-		run_create_and_open ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+		run_create_and_open ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 	if [ "$tc"X = "directaio"X -o "$tc"X = "all"X ];then
-		run_directaio ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+		run_directaio ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 	if [ "$tc"X = "fillverifyholes"X -o "$tc"X = "all"X ];then
@@ -1042,51 +1056,51 @@ for tc in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do
 	fi
 
 	if [ "$tc"X = "renamewriterace"X -o "$tc"X = "all"X ];then
-		run_renamewriterace ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+		run_renamewriterace ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE} 
 	fi
 
 	if [ "$tc"X = "aiostress"X -o "$tc"X = "all"X ];then
-		run_aiostress ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+		run_aiostress ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 	if [ "$tc"X = "filesizelimits"X -o "$tc"X = "all"X ];then
-		run_filesizelimits ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+		run_filesizelimits ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 	if [ "$tc"X = "mmaptruncate"X -o "$tc"X = "all"X ];then
-		run_mmaptruncate ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+		run_mmaptruncate ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 	if [ "$tc"X = "buildkernel"X -o "$tc"X = "all"X ];then
-		run_buildkernel ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${KERNELSRC}
+		run_buildkernel ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${KERNELSRC} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 	if [ "$tc"X = "splice"X -o "$tc"X = "all"X ];then
-		run_splice ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+		run_splice ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 	if [ "$tc"X = "sendfile"X -o "$tc"X = "all"X ];then
-		run_sendfile ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+		run_sendfile ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 	if [ "$tc"X = "mmap"X -o "$tc"X = "all"X ];then
-		run_mmap ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+		run_mmap ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 	if [ "$tc"X = "reserve_space"X -o "$tc"X = "all"X ];then
-		run_reserve_space ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+		run_reserve_space ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 	if [ "$tc"X = "inline"X -o "$tc"X = "all"X ];then
-		run_inline_data ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+		run_inline_data ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 	if [ "$tc"X = "xattr"X -o "$tc"X = "all"X ];then
-		run_xattr_test ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+		run_xattr_test ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 	if [ "$tc"X = "reflink"X -o "$tc"X = "all"X ];then
-		run_reflink_test ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+		run_reflink_test ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 	if [ "$tc"X = "filecheck"X ];then
@@ -1096,15 +1110,15 @@ for tc in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do
 # For tools test.
 
 	if [ "$tc"X = "mkfs"X -o "$tc"X = "all"X ];then
-		run_mkfs ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+		run_mkfs ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 	if [ "$tc"X = "tunefs"X -o "$tc"X = "all"X ];then
-		run_tunefs ${LOGDIR} ${DEVICE} ${MOUNTPOINT}
+		run_tunefs ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 	if [ "$tc"X = "backup_super"X -o "$tc"X = "all"X ];then
-		run_backup_super ${LOGDIR} ${DEVICE}
+		run_backup_super ${LOGDIR} ${DEVICE} ${BLOCKSIZE} ${CLUSTERSIZE}
 	fi
 
 done
diff --git a/programs/reflink_tests/reflink_test_run.sh b/programs/reflink_tests/reflink_test_run.sh
index 5c4d233..6382f0d 100755
--- a/programs/reflink_tests/reflink_test_run.sh
+++ b/programs/reflink_tests/reflink_test_run.sh
@@ -98,13 +98,15 @@ set -o pipefail
 function f_usage()
 {
         echo "usage: `basename ${0}` [-D <-a remote_listener_addr_in_IPV4> <-p port>] \
-[-v verify_log] [-W] [-A] [-o logdir] <-d device> <mountpoint path>"
+[-v verify_log] [-W] [-A] [-o logdir] <-d device> <-b blocksize> <-c clustersize> <mountpoint path>"
         echo "       -o output directory for the logs"
         echo "       -d block device name used for ocfs2 volume"
         echo "       -W enable data=writeback mode"
 	echo "       -A enable asynchronous io testing mode"
 	echo "       -D enable destructive test,it will crash the testing node,\
 be cautious, you need to specify listener addr and port then"
+	echo "	     -b block size"
+	echo "	     -c cluster size"
         echo "       <mountpoint path> specify the testing mounting point."
         exit 1;
 
@@ -117,7 +119,7 @@ function f_getoptions()
                 exit 1
          fi
 
-         while getopts "o:WDAhd:a:p:v:" options; do
+         while getopts "o:WDAhd:a:p:v:b:c:" options; do
                 case $options in
                 o ) LOG_DIR="$OPTARG";;
                 d ) DEVICE="$OPTARG";;
@@ -127,6 +129,8 @@ function f_getoptions()
 		a ) LISTENER_ADDR="$OPTARG";;
 		p ) LISTENER_PORT="$OPTARG";;
 		v ) VERI_LOG="$OPTARG";;
+		b ) BLOCKSIZE="$OPTARG";;
+		c ) CLUSTERSIZE="$OPTARG";;
                 h ) f_usage;;
                 * ) f_usage;;
                 esac
@@ -172,6 +176,11 @@ function f_check()
 		fi
 	fi
 
+	if [ -z "${BLOCKSIZE}" -o -z "${CLUSTERSIZE}" ];then
+		echo "Please specify blocksize and clustersiz."
+		exit 1
+	fi
+
         LOG_DIR=${LOG_DIR:-$DEFAULT_LOG_DIR}
 	${MKDIR_BIN} -p ${LOG_DIR} || exit 1
 
@@ -735,17 +744,11 @@ f_LogRunMsg ${RUN_LOG_FILE} "=====================Reflink tests start:  `date`\
 f_LogMsg ${LOG_FILE} "=====================Reflink tests start:  `date`\
 ====================="
 
-#for BLOCKSIZE in 512 1024 4096;do
-#	for CLUSTERSIZE in 4096 32768 1048576;do
-for BLOCKSIZE in 4096;do
-	for CLUSTERSIZE in 1048576;do
-		f_LogRunMsg ${RUN_LOG_FILE} "<- Running test with ${BLOCKSIZE} \
+f_LogRunMsg ${RUN_LOG_FILE} "<- Running test with ${BLOCKSIZE} \
 bs and ${CLUSTERSIZE} cs ->\n"
-		f_LogMsg ${LOG_FILE} "<- Running test with ${BLOCKSIZE} bs \
+f_LogMsg ${LOG_FILE} "<- Running test with ${BLOCKSIZE} bs \
 and ${CLUSTERSIZE} cs ->"
-		f_runtest
-	done
-done
+f_runtest
 
 END_TIME=${SECONDS}
 f_LogRunMsg ${RUN_LOG_FILE} "=====================Reflink tests end: `date`\
diff --git a/programs/tunefs-test/tunefs-test.sh b/programs/tunefs-test/tunefs-test.sh
index dc1bd1b..40c1a47 100755
--- a/programs/tunefs-test/tunefs-test.sh
+++ b/programs/tunefs-test/tunefs-test.sh
@@ -40,8 +40,8 @@ BLOCKDEV="`which sudo` -u root `which blockdev`"
 DEVICE=""
 MOUNT_POINT=""
 
-BLOCKSIZE=4k
-CLUSTERSIZE=8k
+BLOCKSIZE=
+CLUSTERSIZE=
 
 LABEL1=ocfs2test
 LABEL2=ocfs2test1
@@ -66,10 +66,12 @@ FS_FEATURES=
 #
 function usage()
 {
-    echo "usage: ${TUNEFS_TEST} -o <outdir> -d <device> -m <mountpoint>"
+    echo "usage: ${TUNEFS_TEST} -o <outdir> -d <device> -m <mountpoint> -b <blocksize> -c <clustersize>"
     echo "       -o output directory for the logs"
     echo "       -d device"
     echo "       -m mountpoint"
+    echo "       -b blocksize"
+    echo "       -c clustersize"
     exit 1
 }
 # 
@@ -502,123 +504,111 @@ Journal_Node_Change()
 #
 Enable_Disable_Inline_Data()
 {
-        local O_BLOCKSIZE
-        local O_CLUSTERSIZE
         local RC
         local FILE_INDEX
         local FILE_NUM=1000
         local TEST_FILE
 
-        O_BLOCKSIZE=${BLOCKSIZE}
-        O_CLUSTERSIZE=${CLUSTERSIZE}
-
-        for BLOCKSIZE in 512 1k 4k;do
-                for CLUSTERSIZE in 32k;do
-                        
-                        #set none inline-data support for volume
-                        LogMsg "tunefs_test : Enable/Disable Inline-data"
-                        LogMsg "tunefs_test : BlockSize=${BLOCKSIZE},ClusterSize=${CLUSTERSIZE}"
-                        FS_FEATURES="--fs-features=noinline-data"
-                        Set_Volume_For_Test ${BLKCNT2};
-
-                        #Check if we set none-inline-data for volume
-                        (( ++NUM_OF_TESTS ))
-                        CURRENT_TEST="Set None-inline-data support for volume by mkfs.ocfs2";
-                        ${DEBUGFS_BIN} -n -R "stats" ${DEVICE}|${GREP} -i "Feature Incompat"|${GREP} -q "inline-data"
-                        RC=$?
-                        if [ "$RC" -eq "0" ];then
-                                test_fail
-                        else
-                                ${MOUNT_BIN} -t ocfs2 ${DEVICE} ${MOUNT_POINT}
-				${CHOWN_BIN} -R ${USERNAME}:${GROUPNAME} ${MOUNT_POINT}
-                                for FILE_INDEX in `seq ${FILE_NUM}`;do
-                                        #make sure file size less than max_inline_sz
-                                        TEST_FILE=${MOUNT_POINT}/TEST_EXTENT_FILE_${FILE_INDEX}
-                                        echo "Extent-data-"${FILE_INDEX} >${TEST_FILE}
-                                        sync
-                                        ${DEBUGFS_BIN} -n -R "stat /TEST_EXTENT_FILE_${FILE_INDEX}" ${DEVICE}|${GREP} "Dynamic Features"|${GREP} -q "InlineData"
-                                        RC=$?
-                                        if [ "$RC" -eq "0" ];then
-                                                break
-                                        fi
-                                done
-                                if [ "$RC" -eq "0" ];then
-                                        test_fail
-                                else
-                                        test_pass
-                                fi
-                                ${UMOUNT_BIN} ${DEVICE}
-                        fi
-
-                        #Enable Inline-data support by tunefs
-                        (( ++NUM_OF_TESTS ))
-                        CURRENT_TEST="Enable Inline-data support for volume by tunefs.ocfs2"
-                        FS_FEATURES="--fs-features=inline-data"
-                        echo "y"|${TUNEFS_BIN} ${FS_FEATURES} ${DEVICE} 2>&1 >> ${TUNEFSLOG}
-                        Check_Volume
-                        ${DEBUGFS_BIN} -n -R "stats" ${DEVICE}|${GREP} -i "Feature Incompat"|${GREP} -q "inline-data"
-                        RC=$?
-                        if [ "$RC" -eq "0" ];then
-                                ${MOUNT_BIN} -t ocfs2 ${DEVICE} ${MOUNT_POINT}
-				${CHOWN_BIN} -R ${USERNAME}:${GROUPNAME} ${MOUNT_POINT}
-                                for FILE_INDEX in `seq ${FILE_NUM}`;do
-                                        #make sure file size less than max_inline_sz
-                                        TEST_FILE=${MOUNT_POINT}/TEST_INLINE_FILE_${FILE_INDEX}
-                                        echo "Inline-data-"${FILE_INDEX} >${TEST_FILE}
-                                        sync
-                                        ${DEBUGFS_BIN} -n -R "stat /TEST_INLINE_FILE_${FILE_INDEX}" ${DEVICE}|${GREP} "Dynamic Features"|${GREP} -q "InlineData"
-                                        RC=$?
-                                        if [ "$RC" -ne "0" ];then
-                                                break
-                                        fi
-                                done
-                                if [ "$RC" -eq "0" ];then
-                                        test_pass
-                                else
-                                        test_fail
-                                fi
-                                ${UMOUNT_BIN} ${DEVICE}
-                                
-                        else
-                                test_fail
-                        fi
-
-                        #Disable Inline-data support,extent the inlined inodde
-                        (( ++ NUM_OF_TESTS ))
-                        CURRENT_TEST="Disable Inline-data support for volume by tunefs.ocfs2"
-                        FS_FEATURES="--fs-features=noinline-data"
-                        echo "y"|${TUNEFS_BIN} ${FS_FEATURES} ${DEVICE} 2>&1 >> ${TUNEFSLOG}
-                        Check_Volume
-                        ${DEBUGFS_BIN} -n -R "stats" ${DEVICE}|${GREP} -i "Feature Incompat"|${GREP} -q "inline-data"
-                        RC=$?
-                        if [ "$RC" -eq "0" ] ;then
-                                test_fail
-                        else
-                                #Verify if all inlined inode be extented
-                                for FILE_INDEX in `seq ${FILE_NUM}`;do
-                                        #make sure file size less than max_inline_sz
-                                        TEST_FILE=${MOUNT_POINT}/TEST_INLINE_FILE_${FILE_INDEX}
-                                        ${DEBUGFS_BIN} -n -R "stat /TEST_INLINE_FILE_${FILE_INDEX}" ${DEVICE}|${GREP} "Dynamic Features"|${GREP} -q "InlineData"
-                                        RC=$?
-                                        if [ "$RC" -eq "0" ];then
-                                                break
-                                        fi
-                                done
-                                if [ "$RC" -eq "0" ];then
-                                        test_fail
-                                else
-                                        test_pass
-                                fi
-
-                        fi
-                        
-                done    #done for cluster_sz  loop
-        done    #done for blk_sz  loop
+	#set none inline-data support for volume
+	LogMsg "tunefs_test : Enable/Disable Inline-data"
+	LogMsg "tunefs_test : BlockSize=${BLOCKSIZE},ClusterSize=${CLUSTERSIZE}"
+	FS_FEATURES="--fs-features=noinline-data"
+	Set_Volume_For_Test ${BLKCNT2};
+
+	#Check if we set none-inline-data for volume
+	(( ++NUM_OF_TESTS ))
+	CURRENT_TEST="Set None-inline-data support for volume by mkfs.ocfs2";
+	${DEBUGFS_BIN} -n -R "stats" ${DEVICE}|${GREP} -i "Feature Incompat"|${GREP} -q "inline-data"
+	RC=$?
+	if [ "$RC" -eq "0" ];then
+		test_fail
+	else
+		${MOUNT_BIN} -t ocfs2 ${DEVICE} ${MOUNT_POINT}
+		${CHOWN_BIN} -R ${USERNAME}:${GROUPNAME} ${MOUNT_POINT}
+		for FILE_INDEX in `seq ${FILE_NUM}`;do
+			#make sure file size less than max_inline_sz
+			TEST_FILE=${MOUNT_POINT}/TEST_EXTENT_FILE_${FILE_INDEX}
+			echo "Extent-data-"${FILE_INDEX} >${TEST_FILE}
+			sync
+			${DEBUGFS_BIN} -n -R "stat /TEST_EXTENT_FILE_${FILE_INDEX}" ${DEVICE}|${GREP} "Dynamic Features"|${GREP} -q "InlineData"
+			RC=$?
+			if [ "$RC" -eq "0" ];then
+				break
+			fi
+		done
+		if [ "$RC" -eq "0" ];then
+			test_fail
+		else
+			test_pass
+		fi
+		${UMOUNT_BIN} ${DEVICE}
+	fi
+
+	#Enable Inline-data support by tunefs
+	(( ++NUM_OF_TESTS ))
+	CURRENT_TEST="Enable Inline-data support for volume by tunefs.ocfs2"
+	FS_FEATURES="--fs-features=inline-data"
+	echo "y"|${TUNEFS_BIN} ${FS_FEATURES} ${DEVICE} 2>&1 >> ${TUNEFSLOG}
+	Check_Volume
+	${DEBUGFS_BIN} -n -R "stats" ${DEVICE}|${GREP} -i "Feature Incompat"|${GREP} -q "inline-data"
+	RC=$?
+	if [ "$RC" -eq "0" ];then
+		${MOUNT_BIN} -t ocfs2 ${DEVICE} ${MOUNT_POINT}
+		${CHOWN_BIN} -R ${USERNAME}:${GROUPNAME} ${MOUNT_POINT}
+		for FILE_INDEX in `seq ${FILE_NUM}`;do
+			#make sure file size less than max_inline_sz
+			TEST_FILE=${MOUNT_POINT}/TEST_INLINE_FILE_${FILE_INDEX}
+			echo "Inline-data-"${FILE_INDEX} >${TEST_FILE}
+			sync
+			${DEBUGFS_BIN} -n -R "stat /TEST_INLINE_FILE_${FILE_INDEX}" ${DEVICE}|${GREP} "Dynamic Features"|${GREP} -q "InlineData"
+			RC=$?
+			if [ "$RC" -ne "0" ];then
+				break
+			fi
+		done
+		if [ "$RC" -eq "0" ];then
+			test_pass
+		else
+			test_fail
+		fi
+		${UMOUNT_BIN} ${DEVICE}
+		
+	else
+		test_fail
+	fi
+
+	#Disable Inline-data support,extent the inlined inodde
+	(( ++ NUM_OF_TESTS ))
+	CURRENT_TEST="Disable Inline-data support for volume by tunefs.ocfs2"
+	FS_FEATURES="--fs-features=noinline-data"
+	echo "y"|${TUNEFS_BIN} ${FS_FEATURES} ${DEVICE} 2>&1 >> ${TUNEFSLOG}
+	Check_Volume
+	${DEBUGFS_BIN} -n -R "stats" ${DEVICE}|${GREP} -i "Feature Incompat"|${GREP} -q "inline-data"
+	RC=$?
+	if [ "$RC" -eq "0" ] ;then
+		test_fail
+	else
+		#Verify if all inlined inode be extented
+		for FILE_INDEX in `seq ${FILE_NUM}`;do
+			#make sure file size less than max_inline_sz
+			TEST_FILE=${MOUNT_POINT}/TEST_INLINE_FILE_${FILE_INDEX}
+			${DEBUGFS_BIN} -n -R "stat /TEST_INLINE_FILE_${FILE_INDEX}" ${DEVICE}|${GREP} "Dynamic Features"|${GREP} -q "InlineData"
+			RC=$?
+			if [ "$RC" -eq "0" ];then
+				break
+			fi
+		done
+		if [ "$RC" -eq "0" ];then
+			test_fail
+		else
+			test_pass
+		fi
+
+	fi
+	
 
         ${RM_BIN} -rf ${MOUNT_POINT}/*
         
-        BLOCKSIZE=${O_BLOCKSIZE}
-        CLUSTERSIZE=${O_CLUSTERSIZE}
         FS_FEATURES=
 }
 
@@ -647,12 +637,14 @@ TUNEFS_TEST=`basename $0`
 bindir=`basename ${0}`
 LOG_DIR=`basename ${bindir}`
 
-while getopts "d:o:m:" args
+while getopts "d:o:m:b:c:" args
 do
   case "$args" in
     o) LOG_DIR="$OPTARG";;
     d) DEVICE="$OPTARG";;
     m) MOUNT_POINT="$OPTARG";;
+    b) BLOCKSIZE="$OPTARG";;
+    c) CLUSTERSIZE="$OPTARG";;
   esac
 done
 
diff --git a/programs/xattr_tests/xattr-single-run.sh b/programs/xattr_tests/xattr-single-run.sh
index 794205a..048c04f 100755
--- a/programs/xattr_tests/xattr-single-run.sh
+++ b/programs/xattr_tests/xattr-single-run.sh
@@ -144,10 +144,12 @@ exit_or_not()
 ################################################################################
 f_usage()
 {
-    echo "usage: `basename ${0}` [-c] [-o output_log_dir] <-d <device>> <mountpoint path>"
+    echo "usage: `basename ${0}` [-c] [-o output_log_dir] <-d <device>> <-b <block size>> <-C <cluster size>> <mountpoint path>"
     echo "	 -c enable the combination test for inline-data and inline-xattr."
     echo "       -o output directory for the logs"
     echo "       -d specify the device which has been formated as an ocfs2 volume."
+    echo "	 -b block size."
+    echo "	 -C cluster size."
     echo "       <mountpoint path> path of mountpoint where the ocfs2 volume will be mounted on."
     exit 1;
 
@@ -160,11 +162,13 @@ f_getoptions()
                 exit 1
          fi
 
-	 while getopts "cho:d:" options; do
+	 while getopts "cho:d:b:C:" options; do
                 case $options in
 		c ) COMBIN_TEST="1";;
                 o ) LOG_OUT_DIR="$OPTARG";;
                 d ) OCFS2_DEVICE="$OPTARG";;
+		b ) BLOCKSIZE="$OPTARG";;
+		C ) CLUSTERSIZE="$OPTARG";;
                 h ) f_usage
                     exit 1;;
                 * ) f_usage
@@ -1068,22 +1072,14 @@ START_TIME=${SECONDS}
 echo "=====================Single node xattr testing starts: `date`=====================" |tee -a ${RUN_LOG_FILE}
 echo "=====================Single node xattr testing starts: `date`=====================" >> ${DETAIL_LOG_FILE}
 
-#for BLOCKSIZE in 512 1024 2048 4096
-for BLOCKSIZE in 512 4096
-do
-#        for CLUSTERSIZE in 4096 32768 1048576
-        for CLUSTERSIZE in 4096 1048576
-        do
-                echo "++++++++++xattr tests with \"-b ${BLOCKSIZE} -C ${CLUSTERSIZE}\"++++++++++" |tee -a ${RUN_LOG_FILE}
-                echo "++++++++++xattr tests with \"-b ${BLOCKSIZE} -C ${CLUSTERSIZE}\"++++++++++">>${DETAIL_LOG_FILE}
-                echo "======================================================================================="
-                f_do_mkfs_and_mount
-                f_runtest
-                f_do_umount
-                echo "======================================================================================="
-                echo -e "\n\n\n">>${DETAIL_LOG_FILE}
-        done
-done
+echo "++++++++++xattr tests with \"-b ${BLOCKSIZE} -C ${CLUSTERSIZE}\"++++++++++" |tee -a ${RUN_LOG_FILE}
+echo "++++++++++xattr tests with \"-b ${BLOCKSIZE} -C ${CLUSTERSIZE}\"++++++++++">>${DETAIL_LOG_FILE}
+echo "======================================================================================="
+f_do_mkfs_and_mount
+f_runtest
+f_do_umount
+echo "======================================================================================="
+echo -e "\n\n\n">>${DETAIL_LOG_FILE}
 f_cleanup
 
 END_TIME=${SECONDS}
-- 
2.6.6




More information about the Ocfs2-test-devel mailing list