Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 00/17] ocfs2-test: misc improvements and trivial fixes
- Misc trivial fixes: [PATCH 01/17] ocfs2 test: correct the check on testcase if supported [PATCH 02/17] Single Run: kernel building is little broken now [PATCH 03/17] Trivial: better not to depend on where we issue testing [PATCH 04/17] Trivial: fix a typo mistake [PATCH 05/17] Trivial: fix checking empty return value [PATCH 06/17] multi_mmap: make log messages go to right place [PATCH 07/17] lvb_torture: failed when pcmk is used as cluster stack [PATCH 08/17] multiple node: pass cross_delete the right log file - This patches add two more parameters: blocksize and clustersize when we kick off a testing, which shortens the run time of a testing round. It will keep the old behaviors if they are not specified. [PATCH 09/17] Single run: make blocksize and clustersize as [PATCH 10/17] Multiple run: make blocksize and clustersize as [PATCH 11/17] discontig bg: make blocksize and clustersize as - This patch reflects the mkfs.ocfs2 changes that "--cluster-stack" and "--cluster-name" were added. [PATCH 12/17] Add two cluster-aware parameters: cluster stack and cluster name - More misc trival fixes: [PATCH 13/17] Save punch_hole details into logfile for debugging [PATCH 14/17] Fix openmpi warning by specifying proper slot number [PATCH 15/17] Handle the case when a symbolic link device is given [PATCH 16/17] inline data: fix build error [PATCH 17/17] discontig bg: give single and multiple node test Comments and questions are, as always, welcome. Thanks, Eric
Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 01/17] ocfs2 test: correct the check on testcase if supported
Signed-off-by: Eric Ren <zren at suse.com> --- programs/python_common/multiple_run.sh | 2 +- programs/python_common/single_run-WIP.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/python_common/multiple_run.sh b/programs/python_common/multiple_run.sh index dd9603f..c4a7da9 100755 --- a/programs/python_common/multiple_run.sh +++ b/programs/python_common/multiple_run.sh @@ -201,7 +201,7 @@ f_setup() fi SUPPORTED_TESTCASES="all xattr inline reflink write_append_truncate multi_mmap create_racer flock_unit cross_delete open_delete lvb_torture" - for cas in ${TESTCASES}; do + for cas in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do echo ${SUPPORTED_TESTCASES} | grep -sqw $cas if [ $? -ne 0 ]; then echo "testcase [${cas}] not supported." diff --git a/programs/python_common/single_run-WIP.sh b/programs/python_common/single_run-WIP.sh index 5a8fae1..fe0056c 100755 --- a/programs/python_common/single_run-WIP.sh +++ b/programs/python_common/single_run-WIP.sh @@ -997,7 +997,7 @@ fi 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" -for cas in ${TESTCASES}; do +for cas in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do echo ${SUPPORTED_TESTCASES} | grep -sqw $cas if [ $? -ne 0 ]; then echo "testcase [${cas}] not supported." -- 2.6.6
Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 02/17] Single Run: kernel building is little broken now
Only check kernel source if we specify "buildkernel" test case. The original kernel source web-link cannot be reached, so give a new link instead but the md5sum check is missing now. Signed-off-by: Eric Ren <zren at suse.com> --- programs/python_common/single_run-WIP.sh | 56 ++++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/programs/python_common/single_run-WIP.sh b/programs/python_common/single_run-WIP.sh index fe0056c..61008d8 100755 --- a/programs/python_common/single_run-WIP.sh +++ b/programs/python_common/single_run-WIP.sh @@ -20,9 +20,9 @@ WGET=`which wget` WHOAMI=`which whoami` SED=`which sed` -DWNLD_PATH="http://oss.oracle.com/~smushran/ocfs2-test" -KERNEL_TARBALL="linux-kernel.tar.gz" -KERNEL_TARBALL_CHECK="${KERNEL_TARBALL}.md5sum" +DWNLD_PATH="https://cdn.kernel.org/pub/linux/kernel/v3.x/" +KERNEL_TARBALL="linux-3.2.80.tar.xz" +#KERNEL_TARBALL_CHECK="${KERNEL_TARBALL}.md5sum" USERID=`${WHOAMI}` DEBUGFS_BIN="${SUDO} `which debugfs.ocfs2`" @@ -85,7 +85,7 @@ get_bits() # get_kernel_source $LOGDIR $DWNLD_PATH $KERNEL_TARBALL $KERNEL_TARBALL_CHECK get_kernel_source() { - if [ "$#" -lt "4" ]; then + if [ "$#" -lt "3" ]; then ${ECHO} "Error in get_kernel_source()" exit 1 fi @@ -93,18 +93,18 @@ get_kernel_source() logdir=$1 dwnld_path=$2 kernel_tarball=$3 - kernel_tarball_check=$4 + #kernel_tarball_check=$4 cd ${logdir} outlog=get_kernel_source.log - ${WGET} -o ${outlog} ${dwnld_path}/${kernel_tarball_check} - if [ $? -ne 0 ]; then - ${ECHO} "ERROR downloading ${dwnld_path}/${kernel_tarball_check}" - cd - - exit 1 - fi +# ${WGET} -o ${outlog} ${dwnld_path}/${kernel_tarball_check} +# if [ $? -ne 0 ]; then +# ${ECHO} "ERROR downloading ${dwnld_path}/${kernel_tarball_check}" +# cd - +# exit 1 +# fi ${WGET} -a ${outlog} ${dwnld_path}/${kernel_tarball} if [ $? -ne 0 ]; then @@ -113,13 +113,13 @@ get_kernel_source() exit 1 fi - ${MD5SUM} -c ${kernel_tarball_check} >>${outlog} 2>&1 - if [ $? -ne 0 ]; then - ${ECHO} "ERROR ${kernel_tarball_check} check failed" - cd - - exit 1 - fi - cd - +# ${MD5SUM} -c ${kernel_tarball_check} >>${outlog} 2>&1 +# if [ $? -ne 0 ]; then +# ${ECHO} "ERROR ${kernel_tarball_check} check failed" +# cd - +# exit 1 +# fi +# cd - } # do_format() ${BLOCKSIZE} ${CLUSTERSIZE} ${FEATURES} ${DEVICE} @@ -1012,16 +1012,6 @@ LOGFILE=${LOGDIR}/single_run.log do_mkdir ${LOGDIR} -if [ -z ${KERNELSRC} ]; then - get_kernel_source $LOGDIR $DWNLD_PATH $KERNEL_TARBALL $KERNEL_TARBALL_CHECK - KERNELSRC=${LOGDIR}/${KERNEL_TARBALL} -fi - -if [ ! -f ${KERNELSRC} ]; then - ${ECHO} "No kernel source" - usage -fi - STARTRUN=$(date +%s) log_message "*** Start Single Node test ***" @@ -1058,6 +1048,16 @@ for tc in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do fi if [ "$tc"X = "buildkernel"X -o "$tc"X = "all"X ];then + if [ -z ${KERNELSRC} ]; then + get_kernel_source $LOGDIR $DWNLD_PATH $KERNEL_TARBALL #$KERNEL_TARBALL_CHECK + KERNELSRC=${LOGDIR}/${KERNEL_TARBALL} + fi + + if [ ! -f ${KERNELSRC} ]; then + ${ECHO} "No kernel source" + usage + fi + run_buildkernel ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${KERNELSRC} fi -- 2.6.6
Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 03/17] Trivial: better not to depend on where we issue testing
If we issue testing outsides directory where executives are, error likes the below may occur: "./config.sh No such file or directory". So let's depend on PATH environment rather that. Signed-off-by: Eric Ren <zren at suse.com> --- programs/dirop_fileop_racer/racer.sh | 48 +++++++++++----------- programs/dx_dirs_tests/index_dir_run.sh | 2 +- programs/dx_dirs_tests/multi_index_dir_run.sh | 2 +- programs/inline-data/multi-inline-run.sh | 2 +- programs/inline-data/single-inline-run.sh | 2 +- .../inode_alloc_perf_tests/inode_alloc_perf.sh | 2 +- .../multi_inode_alloc_perf.sh | 2 +- .../multi_inode_alloc_perf_runner.sh | 2 +- .../iozone/iozone3_263/src/current/Generate_Graphs | 26 ++++++------ programs/logwriter/enospc.sh | 2 +- programs/logwriter/rename_write_race.sh | 2 +- programs/python_common/o2tf.sh | 2 +- programs/python_common/single_run-WIP.sh | 4 +- programs/python_common/single_run.sh | 2 +- .../tunefs-test/remove-slot/corrupt_remove_slot.sh | 2 +- programs/xattr_tests/xattr-multi-run.sh | 2 +- programs/xattr_tests/xattr-single-run.sh | 2 +- 17 files changed, 53 insertions(+), 53 deletions(-) diff --git a/programs/dirop_fileop_racer/racer.sh b/programs/dirop_fileop_racer/racer.sh index 819efa8..7e83b7a 100755 --- a/programs/dirop_fileop_racer/racer.sh +++ b/programs/dirop_fileop_racer/racer.sh @@ -37,37 +37,37 @@ DIR="race" # [ -e $DIR ] || mkdir $DIR -./file_create.sh $DIR $MAX_FILES & -./file_create.sh $DIR $MAX_FILES & -./file_create.sh $DIR $MAX_FILES & +file_create.sh $DIR $MAX_FILES & +file_create.sh $DIR $MAX_FILES & +file_create.sh $DIR $MAX_FILES & -./dir_create.sh $DIR $MAX_FILES & -./dir_create.sh $DIR $MAX_FILES & -./dir_create.sh $DIR $MAX_FILES & +dir_create.sh $DIR $MAX_FILES & +dir_create.sh $DIR $MAX_FILES & +dir_create.sh $DIR $MAX_FILES & -./file_rename.sh $DIR $MAX_FILES & -./file_rename.sh $DIR $MAX_FILES & -./file_rename.sh $DIR $MAX_FILES & +file_rename.sh $DIR $MAX_FILES & +file_rename.sh $DIR $MAX_FILES & +file_rename.sh $DIR $MAX_FILES & -./file_link.sh $DIR $MAX_FILES & -./file_link.sh $DIR $MAX_FILES & -./file_link.sh $DIR $MAX_FILES & +file_link.sh $DIR $MAX_FILES & +file_link.sh $DIR $MAX_FILES & +file_link.sh $DIR $MAX_FILES & -./file_symlink.sh $DIR $MAX_FILES & -./file_symlink.sh $DIR $MAX_FILES & -./file_symlink.sh $DIR $MAX_FILES & +file_symlink.sh $DIR $MAX_FILES & +file_symlink.sh $DIR $MAX_FILES & +file_symlink.sh $DIR $MAX_FILES & -./file_concat.sh $DIR $MAX_FILES & -./file_concat.sh $DIR $MAX_FILES & -./file_concat.sh $DIR $MAX_FILES & +file_concat.sh $DIR $MAX_FILES & +file_concat.sh $DIR $MAX_FILES & +file_concat.sh $DIR $MAX_FILES & -./file_list.sh $DIR & -./file_list.sh $DIR & -./file_list.sh $DIR & +file_list.sh $DIR & +file_list.sh $DIR & +file_list.sh $DIR & -./file_rm.sh $DIR $MAX_FILES & -./file_rm.sh $DIR $MAX_FILES & -./file_rm.sh $DIR $MAX_FILES & +file_rm.sh $DIR $MAX_FILES & +file_rm.sh $DIR $MAX_FILES & +file_rm.sh $DIR $MAX_FILES & echo "CTRL-C to exit" trap " diff --git a/programs/dx_dirs_tests/index_dir_run.sh b/programs/dx_dirs_tests/index_dir_run.sh index 381d144..bbd2fdc 100755 --- a/programs/dx_dirs_tests/index_dir_run.sh +++ b/programs/dx_dirs_tests/index_dir_run.sh @@ -43,7 +43,7 @@ ################################################################################ # Global Variables ################################################################################ -. ./o2tf.sh +. `dirname ${0}`/o2tf.sh BLOCKSIZE CLUSTERSIZEdiff --git a/programs/dx_dirs_tests/multi_index_dir_run.sh b/programs/dx_dirs_tests/multi_index_dir_run.sh index eb72a7d..c83b9f7 100755 --- a/programs/dx_dirs_tests/multi_index_dir_run.sh +++ b/programs/dx_dirs_tests/multi_index_dir_run.sh @@ -41,7 +41,7 @@ ################################################################################ # Global Variables ################################################################################ -. ./o2tf.sh +. `dirname ${0}`/o2tf.sh BLOCKSIZE CLUSTERSIZEdiff --git a/programs/inline-data/multi-inline-run.sh b/programs/inline-data/multi-inline-run.sh index 30e2e6a..1d51443 100755 --- a/programs/inline-data/multi-inline-run.sh +++ b/programs/inline-data/multi-inline-run.sh @@ -19,7 +19,7 @@ PATH=$PATH:/sbin # Add /sbin to the path for ocfs2 tools export PATH=$PATH:. -. ./config.sh +. `dirname ${0}`/config.sh #MPIRUN="`which mpirun`" diff --git a/programs/inline-data/single-inline-run.sh b/programs/inline-data/single-inline-run.sh index 938f461..5a176cd 100755 --- a/programs/inline-data/single-inline-run.sh +++ b/programs/inline-data/single-inline-run.sh @@ -19,7 +19,7 @@ PATH=$PATH:/sbin # Add /sbin to the path for ocfs2 tools export PATH=$PATH:. -. ./config.sh +. `dirname ${0}`/config.sh USERNAME=`id -un` GROUPNAME=`id -gn` diff --git a/programs/inode_alloc_perf_tests/inode_alloc_perf.sh b/programs/inode_alloc_perf_tests/inode_alloc_perf.sh index 2ca738a..c561bd2 100755 --- a/programs/inode_alloc_perf_tests/inode_alloc_perf.sh +++ b/programs/inode_alloc_perf_tests/inode_alloc_perf.sh @@ -33,7 +33,7 @@ PATH=$PATH:/sbin # Add /sbin to the path for ocfs2 tools export PATH=$PATH:. -. ./config.sh +. `dirname ${0}`/config.sh SUDO="`which sudo` -u root" RM_BIN="`which rm`" diff --git a/programs/inode_alloc_perf_tests/multi_inode_alloc_perf.sh b/programs/inode_alloc_perf_tests/multi_inode_alloc_perf.sh index c54e80f..45944a5 100755 --- a/programs/inode_alloc_perf_tests/multi_inode_alloc_perf.sh +++ b/programs/inode_alloc_perf_tests/multi_inode_alloc_perf.sh @@ -33,7 +33,7 @@ PATH=$PATH:/sbin # Add /sbin to the path for ocfs2 tools export PATH=$PATH:. -. ./config.sh +. `dirname ${0}`/config.sh #BINDIR=./ SUDO="`which sudo` -u root" diff --git a/programs/inode_alloc_perf_tests/multi_inode_alloc_perf_runner.sh b/programs/inode_alloc_perf_tests/multi_inode_alloc_perf_runner.sh index 39265d9..ab82ced 100755 --- a/programs/inode_alloc_perf_tests/multi_inode_alloc_perf_runner.sh +++ b/programs/inode_alloc_perf_tests/multi_inode_alloc_perf_runner.sh @@ -31,7 +31,7 @@ PATH=$PATH:/sbin # Add /sbin to the path for ocfs2 tools export PATH=$PATH:. -. ./config.sh +. `dirname ${0}`/config.sh SUDO="`which sudo` -u root" RM_BIN="`which rm`" diff --git a/programs/iozone/iozone3_263/src/current/Generate_Graphs b/programs/iozone/iozone3_263/src/current/Generate_Graphs index 7c14a9a..0127ac0 100755 --- a/programs/iozone/iozone3_263/src/current/Generate_Graphs +++ b/programs/iozone/iozone3_263/src/current/Generate_Graphs @@ -12,19 +12,19 @@ # Generate data base for all of the operation types. -./gengnuplot.sh $1 write -./gengnuplot.sh $1 rewrite -./gengnuplot.sh $1 read -./gengnuplot.sh $1 reread -./gengnuplot.sh $1 randread -./gengnuplot.sh $1 randwrite -./gengnuplot.sh $1 bkwdread -./gengnuplot.sh $1 recrewrite -./gengnuplot.sh $1 strideread -./gengnuplot.sh $1 fwrite -./gengnuplot.sh $1 frewrite -./gengnuplot.sh $1 fread -./gengnuplot.sh $1 freread +gengnuplot.sh $1 write +gengnuplot.sh $1 rewrite +gengnuplot.sh $1 read +gengnuplot.sh $1 reread +gengnuplot.sh $1 randread +gengnuplot.sh $1 randwrite +gengnuplot.sh $1 bkwdread +gengnuplot.sh $1 recrewrite +gengnuplot.sh $1 strideread +gengnuplot.sh $1 fwrite +gengnuplot.sh $1 frewrite +gengnuplot.sh $1 fread +gengnuplot.sh $1 freread # Produce graphs and postscript results. gnuplot gnu3d.dem diff --git a/programs/logwriter/enospc.sh b/programs/logwriter/enospc.sh index b4665bf..08c5d6a 100755 --- a/programs/logwriter/enospc.sh +++ b/programs/logwriter/enospc.sh @@ -4,7 +4,7 @@ # if [ `dirname ${0}` == '.' ]; then if [ -f config.sh ]; then - . ./config.sh; + . `dirname ${0}`/config.sh fi; else if [ -f `dirname ${0}`/config.sh ]; then diff --git a/programs/logwriter/rename_write_race.sh b/programs/logwriter/rename_write_race.sh index 4910963..fd5e6d0 100755 --- a/programs/logwriter/rename_write_race.sh +++ b/programs/logwriter/rename_write_race.sh @@ -32,7 +32,7 @@ exit 1; } if [ `dirname ${0}` == '.' ]; then if [ -f config.sh ]; then - . ./config.sh; + . `dirname ${0}`/config.sh fi; else if [ -f `dirname ${0}`/config.sh ]; then diff --git a/programs/python_common/o2tf.sh b/programs/python_common/o2tf.sh index 2f2654b..a7e8b49 100755 --- a/programs/python_common/o2tf.sh +++ b/programs/python_common/o2tf.sh @@ -25,7 +25,7 @@ PATH=$PATH:/sbin # Add /sbin to the path for ocfs2 tools export PATH=$PATH:. -. ./config.sh +. `dirname ${0}`/config.sh MKFS_BIN="`which sudo` -u root `which mkfs.ocfs2`" FSCK_BIN="`which sudo` -u root `which fsck.ocfs2`" diff --git a/programs/python_common/single_run-WIP.sh b/programs/python_common/single_run-WIP.sh index 61008d8..99f24cc 100755 --- a/programs/python_common/single_run-WIP.sh +++ b/programs/python_common/single_run-WIP.sh @@ -858,14 +858,14 @@ run_reflink_test() #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} ${mountpoint} || { RC=$? log_end ${RC} } #writeback mount option #log_start "reflink_test" "writeback" - #./reflink_test_run.sh -W -o ${logdir} -d ${device} ${mountpoint} + #reflink_test_run.sh -W -o ${logdir} -d ${device} ${mountpoint} RC=$? log_end ${RC} } diff --git a/programs/python_common/single_run.sh b/programs/python_common/single_run.sh index 75c626f..e55054e 100755 --- a/programs/python_common/single_run.sh +++ b/programs/python_common/single_run.sh @@ -207,7 +207,7 @@ LogRC $?; # MAIN # # -. ./config.sh +. `dirname ${0}`/config.sh # if [ $# -ne 2 ]; then Usage; diff --git a/programs/tunefs-test/remove-slot/corrupt_remove_slot.sh b/programs/tunefs-test/remove-slot/corrupt_remove_slot.sh index 26f39a6..24faacb 100755 --- a/programs/tunefs-test/remove-slot/corrupt_remove_slot.sh +++ b/programs/tunefs-test/remove-slot/corrupt_remove_slot.sh @@ -128,7 +128,7 @@ function patch_tunefs() cd $CORRUPT_SRC patch -p1 < $pwd/corrupt_remove_slot.patch exit_if_bad $? 0 "Can't patch the src directory." - ./autogen.sh + autogen.sh make if [ ! -x "$CORRUPT_SRC/tunefs.ocfs2/tunefs.ocfs2" ];then echo "Can't build the specified tunefs.ocfs2." diff --git a/programs/xattr_tests/xattr-multi-run.sh b/programs/xattr_tests/xattr-multi-run.sh index 7905102..7b0f7e0 100755 --- a/programs/xattr_tests/xattr-multi-run.sh +++ b/programs/xattr_tests/xattr-multi-run.sh @@ -36,7 +36,7 @@ PATH=$PATH:/sbin # Add /sbin to the path for ocfs2 tools export PATH=$PATH:. -. ./config.sh +. `dirname ${0}`/config.sh RM="`which rm`" MKDIR="`which mkdir`" diff --git a/programs/xattr_tests/xattr-single-run.sh b/programs/xattr_tests/xattr-single-run.sh index 794205a..09044e1 100755 --- a/programs/xattr_tests/xattr-single-run.sh +++ b/programs/xattr_tests/xattr-single-run.sh @@ -35,7 +35,7 @@ PATH=$PATH:/sbin # Add /sbin to the path for ocfs2 tools export PATH=$PATH:. -. ./config.sh +. `dirname ${0}`/config.sh GETXATTR="`which sudo` -u root `which getfattr`" SETXATTR="`which sudo` -u root `which setfattr`" -- 2.6.6
Signed-off-by: Eric Ren <zren at suse.com> --- programs/mkfs-tests/mkfs-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/mkfs-tests/mkfs-test.sh b/programs/mkfs-tests/mkfs-test.sh index 3fc93a4..8fdd02a 100755 --- a/programs/mkfs-tests/mkfs-test.sh +++ b/programs/mkfs-tests/mkfs-test.sh @@ -431,7 +431,7 @@ fi; echo "Test ${testnum}: -L mylabel" |tee -a ${LOGFILE} label="my_label_is_very_very_very_long_to_the_point_of_being_useless" echo -n "mkfs ..... " |tee -a ${LOGFILE} -${MKFS} -x -F -b 4K -C 4K -N 1 -L ${label} ${device} 262144 >{OUt} 2>&1 +${MKFS} -x -F -b 4K -C 4K -N 1 -L ${label} ${device} 262144 >${OUT} 2>&1 echo "OK" |tee -a ${LOGFILE} echo -n "verify ..... " |tee -a ${LOGFILE} ${DEBUGFS} -R "stats" ${device} >${OUT} 2>&1 -- 2.6.6
Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 05/17] Trivial: fix checking empty return value
We now get the below error even if "reserve space" testcase succeeds: "Error in log_end()" This is because we passed Nil to log_end. Signed-off-by: Eric Ren <zren at suse.com> --- programs/python_common/single_run-WIP.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/programs/python_common/single_run-WIP.sh b/programs/python_common/single_run-WIP.sh index 99f24cc..d474463 100755 --- a/programs/python_common/single_run-WIP.sh +++ b/programs/python_common/single_run-WIP.sh @@ -781,6 +781,7 @@ run_reserve_space() done do_umount ${mountpoint} + RC=$? log_end ${RC} done -- 2.6.6
Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 06/17] multi_mmap: make log messages go to right place
The option "--logfile" is missing now. Thus, log messages go into "o2t.log", which is a apparent mistake. Signed-off-by: Eric Ren <zren at suse.com> --- programs/python_common/multiple_run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/python_common/multiple_run.sh b/programs/python_common/multiple_run.sh index c4a7da9..2e0ec72 100755 --- a/programs/python_common/multiple_run.sh +++ b/programs/python_common/multiple_run.sh @@ -339,7 +339,7 @@ run_multi_mmap_test() local testfile=${workplace}/multi_mmap_test_file run_common_testcase "multi_mmap" "sparse,unwritten,inline-data" \ -"${BINDIR}/run_multi_mmap.py -i 20000 -I ${INTERFACE} -n ${NODE_LIST} -c -b 6000 --hole -f ${testfile}" +"${BINDIR}/run_multi_mmap.py -i 20000 -I ${INTERFACE} -l ${logfile} -n ${NODE_LIST} -c -b 6000 --hole -f ${testfile}" } run_create_racer_test() -- 2.6.6
Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 07/17] lvb_torture: failed when pcmk is used as cluster stack
This test case failed with "pcmk" stack. Output errors like: "rank 1: /dlm/ has no write permission." "rank 1: o2dlm_initialize failed: -1485330936". Signed-off-by: Eric Ren <zren at suse.com> --- programs/lvb_torture/lvb_torture.c | 110 ++++++++++++++++++++++++++++++++- programs/python_common/multiple_run.sh | 12 +++- 2 files changed, 117 insertions(+), 5 deletions(-) diff --git a/programs/lvb_torture/lvb_torture.c b/programs/lvb_torture/lvb_torture.c index 1459849..93a29ec 100644 --- a/programs/lvb_torture/lvb_torture.c +++ b/programs/lvb_torture/lvb_torture.c @@ -180,6 +180,101 @@ static void run_test(struct o2dlm_ctxt *dlm, char *lockid) } } +/* + * Copied from run_test(), this is a ugly but straightforward workaround. + * "fsdlm" is used when using pcmk as cluster stack, which only supports + * 32-bits lvb so far. + */ +static void run_test_fsdlm(struct o2dlm_ctxt *dlm, char *lockid) +{ + unsigned long long iter = 0; + unsigned long long expected, to_write = 0; + int ret; + unsigned int read, written; + errcode_t err; + enum o2dlm_lock_level level; + __u32 lvb; + + while (iter < max_iter && !caught_sig) { + expected = iter; + + if ((iter % num_procs) == rank) + level = O2DLM_LEVEL_EXMODE; + else + level = O2DLM_LEVEL_PRMODE; + + if (level == O2DLM_LEVEL_PRMODE) { + ret = MPI_Barrier(MPI_COMM_WORLD); + if (ret != MPI_SUCCESS) + rprintf(rank, "read MPI_Barrier failed: %d\n", ret); + err = o2dlm_lock(dlm, lockid, 0, level); + if (err) + rprintf(rank, "o2dlm_lock failed: %d\n", err); + + expected++; + } else { + err = o2dlm_lock(dlm, lockid, 0, level); + if (err) + rprintf(rank, "o2dlm_lock failed: %d\n", err); + + ret = MPI_Barrier(MPI_COMM_WORLD); + if (ret != MPI_SUCCESS) + rprintf(rank, "read MPI_Barrier failed: %d\n", ret); + to_write = iter + 1; + } + + err = o2dlm_read_lvb(dlm, lockid, (char *)&lvb, sizeof(lvb), + &read); + if (err) + rprintf(rank, "o2dlm_read_lvb failed: %d\n", err); + + lvb = be32_to_cpu(lvb); + + if (level == O2DLM_LEVEL_PRMODE) + printf("%s: read iter: %llu, lvb: %llu exp: %llu\n", + hostname, (unsigned long long)iter, + (unsigned long long)lvb, + (unsigned long long)expected); + else + printf("%s: write iter: %llu, lvb: %llu wri: %llu\n", + hostname, (unsigned long long)iter, + (unsigned long long)lvb, + (unsigned long long)to_write); + + fflush(stdout); + + if (lvb != expected) { + printf("Test failed! %s: rank %d, read lvb %llu, expected %llu\n", + hostname, rank, (unsigned long long) lvb, + (unsigned long long) expected); + MPI_Abort(MPI_COMM_WORLD, 1); + } + + if (level == O2DLM_LEVEL_EXMODE) { + lvb = cpu_to_be32(to_write); + + err = o2dlm_write_lvb(dlm, lockid, (char *)&lvb, + sizeof(lvb), &written); + if (err) + rprintf(rank, "o2dlm_write_lvb failed: %d\n", err); + if (written != sizeof(lvb)) + rprintf(rank, "o2dlm_write_lvb() wrote %d, we asked for %d\n", written, sizeof(lvb)); + } + + err = o2dlm_unlock(dlm, lockid); + if (err) + rprintf(rank, "o2dlm_unlock failed: %d\n", err); + + /* This second barrier is not necessary and can be + * commented out to ramp the test up */ + ret = MPI_Barrier(MPI_COMM_WORLD); + if (ret != MPI_SUCCESS) + rprintf(rank, "unlock MPI_Barrier failed: %d\n", ret); + + iter++; + } +} + static void clear_lock(struct o2dlm_ctxt *dlm, char *lockid) { char empty[O2DLM_LOCK_ID_MAX_LEN]; @@ -363,8 +458,7 @@ int main(int argc, char *argv[]) printf("%s: rank: %d, nodes: %d, dlm: %s, dom: %s, lock: %s, iter: %llu\n", hostname, rank, num_procs, dlmfs_path, domain, lockid, (unsigned long long) max_iter); - - if (access(dlmfs_path, W_OK) < 0) { + if (strcmp(dlmfs_path, "NULL") != 0 && access(dlmfs_path, W_OK) < 0) { sleep(2); rprintf(rank, "%s has no write permission.\n", dlmfs_path); return EACCES; @@ -380,6 +474,13 @@ int main(int argc, char *argv[]) rprintf(rank, "start_heartbeat failed\n"); } + /* + * "pcmk" is used as cluster stack if "NULL" + * is passed here + */ + if (strcmp(dlmfs_path, "NULL") == 0) + dlmfs_path = NULL; + error = o2dlm_initialize(dlmfs_path, domain, &dlm); if (error) rprintf(rank, "o2dlm_initialize failed: %d\n", error); @@ -391,7 +492,10 @@ int main(int argc, char *argv[]) if (ret != MPI_SUCCESS) rprintf(rank, "prep MPI_Barrier failed: %d\n", ret); - run_test(dlm, lockid); + if (dlmfs_path) + run_test(dlm, lockid); + else + run_test_fsdlm(dlm, lockid); error = o2dlm_destroy(dlm); if (error) diff --git a/programs/python_common/multiple_run.sh b/programs/python_common/multiple_run.sh index 2e0ec72..4340c40 100755 --- a/programs/python_common/multiple_run.sh +++ b/programs/python_common/multiple_run.sh @@ -31,6 +31,7 @@ DD=`which dd` GREP=`which grep` AWK=`which awk` ECHO="`which echo` -e" +O2CLUSTER="`which o2cluster`" SUDO="`which sudo` -u root" IFCONFIG_BIN="`which ifconfig`" @@ -398,6 +399,7 @@ run_lvb_torture_test() local logfile=${logdir}/lvb_torture_${DATE}.log local workplace=${MOUNT_POINT} local testfile=${workplace}/lvb_torture_test_file + local dlmfs_path="/dlm" ${MKDIR_BIN} -p ${logdir} ${CHMOD_BIN} -R 777 ${logdir} @@ -427,9 +429,15 @@ ${DEVICE} ${FEATURES} ${JOURNALSIZE} ${BLOCKS} local UUID="`${DEBUGFS_BIN} -R stats ${DEVICE} |grep UUID|cut -d: -f 2`" local LOCK="`${DEBUGFS_BIN} -R 'encode lvb_torture_test_file' ${DEVICE}`" - LogMsg "Run lvb_torture, CMD: ${BINDIR}/run_lvb_torture.py -d /dlm/ -i 60000 \ + #dlmfs_path should be "NULL" if cluster stack is "pcmk" + local stack="`${SUDO} ${O2CLUSTER} -r | ${AWK} -F',' '{printf $1}'`" + if [ "$stack" = "pcmk" ];then + dlmfs_path="NULL" + fi + + LogMsg "Run lvb_torture, CMD: ${BINDIR}/run_lvb_torture.py -d ${dlmfs_path} -i 60000 \ -H ${DEVICE} -l ${logfile} -n ${NODE_LIST} "${UUID}" "${LOCK}"" - ${SUDO} ${BINDIR}/run_lvb_torture.py -d /dlm/ -c 60000 -i ${INTERFACE} -l \ + ${SUDO} ${BINDIR}/run_lvb_torture.py -d ${dlmfs_path} -c 60000 -i ${INTERFACE} -l \ ${logfile} -n ${NODE_LIST} "${UUID}" "${LOCK}" >> ${LOGFILE} 2>&1 LogRC $? -- 2.6.6
Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 08/17] multiple node: pass cross_delete the right log file
Pass cross_delete the right log file. However, openmpi should log into config.LOGFILE, because other remote nodes only have this common log file. Signed-off-by: Eric Ren <zren at suse.com> --- programs/cross_delete/cross_delete.py | 4 ++-- programs/python_common/multiple_run.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/programs/cross_delete/cross_delete.py b/programs/cross_delete/cross_delete.py index ec3097c..1694d51 100755 --- a/programs/cross_delete/cross_delete.py +++ b/programs/cross_delete/cross_delete.py @@ -305,7 +305,7 @@ o2tf.OpenMPIInit(DEBUGON, ','.join(nodelist), logfile, 'ssh') cmdline = os.path.join(config.BINDIR, 'crdel_gen_files.py') ret = o2tf.openmpi_run( DEBUGON, nproc, str('%s -s %s -l %s -t %s' % \ (cmdline, stagedir, - options.logfile, + config.LOGFILE, tarfile) ), ','.join(nodelist), 'ssh', @@ -324,7 +324,7 @@ o2tf.OpenMPIInit(DEBUGON, ','.join(nodelist), logfile, 'ssh') else: cmdline = os.path.join(config.BINDIR, 'crdel_del_files.py') ret = o2tf.openmpi_run( DEBUGON, nproc, str('%s -s %s -l %s ' % \ - (cmdline, stagedir, options.logfile) ), + (cmdline, stagedir, config.LOGFILE) ), ','.join(nodelist), 'ssh', options.interface, diff --git a/programs/python_common/multiple_run.sh b/programs/python_common/multiple_run.sh index 4340c40..9e2237a 100755 --- a/programs/python_common/multiple_run.sh +++ b/programs/python_common/multiple_run.sh @@ -318,7 +318,7 @@ run_cross_delete_test() local workplace=${MOUNT_POINT}/cross_delete_test run_common_testcase "cross_delete" "sparse,unwritten,inline-data" \ -"${BINDIR}/cross_delete.py -c 1 -i ${INTERFACE} -d ${workplace} -n ${NODE_LIST} -t ${KERNELSRC}" +"${BINDIR}/cross_delete.py -c 1 -l ${logfile} -i ${INTERFACE} -d ${workplace} -n ${NODE_LIST} -t ${KERNELSRC}" } run_write_append_truncate_test() -- 2.6.6
Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 09/17] Single run: make blocksize and clustersize as parameters
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 | 29 +++- programs/inline-data/single-inline-run.sh | 24 ++- programs/mkfs-tests/mkfs-test.sh | 27 +++- programs/python_common/single_run-WIP.sh | 247 +++++++++++++++++++++-------- programs/reflink_tests/reflink_test_run.sh | 26 ++- programs/tunefs-test/tunefs-test.sh | 28 +++- programs/xattr_tests/xattr-single-run.sh | 26 ++- 7 files changed, 308 insertions(+), 99 deletions(-) diff --git a/programs/backup_super/test_backup_super.sh b/programs/backup_super/test_backup_super.sh index ed7c94b..530109e 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,10 +381,20 @@ function volume_small_test() ################################## function normal_test() { - for blocksize in 512 4096 + if [ "$blocksize" != "NONE" ];then + bslist="$blocksize" + else + bslist="512 4096" + fi + if [ "$clustersize" != "NONE" ];then + cslist="$clustersize" + else + cslist="4096 32768 1048576" + fi + for blocksize in $(echo "$bslist") do for clustersize in \ - 4096 32768 1048576 + $(echo "$cslist") do vol_byte_size=$FIRST_BACKUP_OFF @@ -462,6 +477,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 5a176cd..89b2f4c 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,7 +136,6 @@ f_getoptions() done shift $(($OPTIND -1)) MOUNT_POINT=${1} - } f_setup() @@ -373,9 +376,20 @@ trap ' : ' SIGTERM f_setup $* -for BLOCKSIZE in 512 1024 4096 +if [ "$BLOCKSIZE" != "NONE" ];then + bslist="$BLOCKSIZE" +else + bslist="512 1024 4096" +fi +if [ "$CLUSTERSIZE" != "NONE" ];then + cslist="$CLUSTERSIZE" +else + cslist="4096 32768 1048576" +fi + +for BLOCKSIZE in $(echo "$bslist") do - for CLUSTERSIZE in 4096 32768 1048576 + for CLUSTERSIZE in $(echo "$cslist") 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} diff --git a/programs/mkfs-tests/mkfs-test.sh b/programs/mkfs-tests/mkfs-test.sh index 8fdd02a..67299ac 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 @@ -296,11 +302,22 @@ numblks=1048576 testnum=1 +if [ "$blocksize" != "NONE" ];then + bslist="$blocksize" +else + bslist="512 1024 2048 4096" +fi + +if [ "$clustersize" != "NONE" ];then + cslist="$clustersize" +else + cslist="4096 8192 16384 32768 65536 131072 262144 524288 1048576" +fi ### Test all combinations of blocksizes and clustersizes -for blks in 512 1024 2048 4096 +for blks in $(echo "$bslist") do - for clusts in 4096 8192 16384 32768 65536 131072 262144 524288 1048576 + for clusts in $(echo "$cslist") do TAG=mkfs_test_${testnum} OUT=${outdir}/${TAG}.log diff --git a/programs/python_common/single_run-WIP.sh b/programs/python_common/single_run-WIP.sh index d474463..c7bbfdf 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,20 @@ run_create_and_open() logdir=$1 device=$2 mountpoint=$3 + if [ $4 != "NONE" ];then + blocksize=$4 + else + blocksize=4096 + fi + + if [ $5 != "NONE" ];then + clustersize=$5 + else + clustersize=32768 + fi + workdir=${mountpoint}/create_and_open_test - blocksize=4096 - clustersize=32768 features="sparse,unwritten,inline-data" mountopts="defaults" @@ -269,7 +279,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 +287,19 @@ run_directaio() logdir=$1 device=$2 mountpoint=$3 + if [ $4 != "NONE" ];then + blocksize=$4 + else + blocksize=4096 + fi + + if [ $5 != "NONE" ];then + clustersize=$5 + else + clustersize=32768 + fi workfile=${mountpoint}/directaio_testfile - blocksize=4096 - clustersize=32768 features="sparse,unwritten,inline-data" for mopt in writeback ordered @@ -303,11 +322,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 +334,19 @@ run_aiostress() logdir=$1 device=$2 mountpoint=$3 + if [ $4 != "NONE" ];then + blocksize=$4 + else + blocksize=4096 + fi + + if [ $5 != "NONE" ];then + clustersize=$5 + else + clustersize=32768 + fi workdir=${mountpoint}/testme - blocksize=4096 - clustersize=8192 features="sparse,unwritten,inline-data" for mopt in writeback ordered @@ -347,11 +375,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 +388,20 @@ run_buildkernel() device=$2 mountpoint=$3 kernelsrc=$4 + if [ $5 != "NONE" ];then + blocksize=$5 + else + blocksize=4096 + fi + + if [ $6 != "NONE" ];then + clustersize=$6 + else + clustersize=32768 + fi node=`${HOSTNAME}` workdir=${mountpoint}/testme - blocksize=4096 - clustersize=4096 features="sparse,unwritten,inline-data" for mopt in writeback ordered @@ -392,11 +429,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,10 +441,19 @@ run_filesizelimits() logdir=$1 device=$2 mountpoint=$3 + if [ $4 != "NONE" ];then + blocksize=$4 + else + blocksize=4096 + fi + + if [ $5 != "NONE" ];then + clustersize=$5 + else + clustersize=32768 + fi mountopts=defaults - clustersize=4096 - blocksize=4096 get_bits $blocksize blocksize_bits=$? @@ -566,11 +612,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 +624,19 @@ run_renamewriterace() logdir=$1 device=$2 mountpoint=$3 + if [ $4 != "NONE" ];then + blocksize=$4 + else + blocksize=4096 + fi + + if [ $5 != "NONE" ];then + clustersize=$5 + else + clustersize=32768 + fi workdir=${mountpoint}/testme - blocksize=4096 - clustersize=4096 features="sparse,unwritten,inline-data" for mopt in writeback ordered @@ -608,7 +663,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 +671,19 @@ run_splice() logdir=$1 device=$2 mountpoint=$3 + if [ $4 != "NONE" ];then + blocksize=$4 + else + blocksize=4096 + fi + + if [ $5 != "NONE" ];then + clustersize=$5 + else + clustersize=32768 + fi workdir=${mountpoint}/testme - blocksize=4096 - clustersize=32768 features="sparse,unwritten,inline-data" for mopt in writeback ordered @@ -646,7 +710,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 @@ -655,11 +719,21 @@ run_sendfile() device=$2 mountpoint=$3 + if [ $4 != "NONE" ];then + blocksize=$4 + else + blocksize=4096 + fi + + if [ $5 != "NONE" ];then + clustersize=$5 + else + clustersize=32768 + fi + workfile=${mountpoint}/ocfs2_sendfile_data verifyfile=/tmp/sendfile_verify - blocksize=4096 - clustersize=32768 features="sparse,unwritten,inline-data" port=8001 @@ -697,7 +771,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,12 +779,22 @@ run_mmap() logdir=$1 device=$2 mountpoint=$3 + if [ "$4" != "NONE" ];then + bslist="$4" + else + bslist="512 1024 2048 4096" + fi + if [ "$5" != "NONE" ];then + cslist="$5" + else + cslist="4096 32768 1048576" + fi 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 blocksize in $(echo "$bslist");do + for clustersize in $(echo "$cslist");do for mopt in writeback ordered;do mountopts="data=${mopt}" @@ -736,7 +820,7 @@ run_mmap() 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,14 +828,24 @@ run_reserve_space() logdir=$1 device=$2 mountpoint=$3 + if [ "$4" != "NONE" ];then + bslist="$4" + else + bslist="512 1024 2048 4096" + fi + if [ "$5" != "NONE" ];then + cslist="$5" + else + cslist="4096 32768 1048576" + fi 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 blocksize in $(echo "$bslist");do + for clustersize in $(echo "$cslist");do for mopt in writeback ordered;do mountopts="data=${mopt}" @@ -792,7 +886,7 @@ run_reserve_space() 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 @@ -800,9 +894,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} } @@ -810,7 +906,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 @@ -819,9 +915,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} } @@ -829,7 +927,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 @@ -837,9 +935,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} @@ -848,7 +948,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 @@ -856,17 +956,19 @@ 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} } #writeback mount option #log_start "reflink_test" "writeback" - #reflink_test_run.sh -W -o ${logdir} -d ${device} ${mountpoint} + #reflink_test_run.sh -W -o ${logdir} -d ${device} -b ${blocksize} -c ${clustersize} ${mountpoint} RC=$? log_end ${RC} } @@ -895,7 +997,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 @@ -903,9 +1005,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} } @@ -913,7 +1017,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 @@ -921,9 +1025,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} } @@ -931,16 +1037,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} } @@ -953,11 +1061,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";; @@ -965,6 +1073,8 @@ do k) KERNELSRC="$OPTARG";; l) OUTDIR="$OPTARG";; t) TESTCASES="$OPTARG";; + b) BLOCKSIZE="$OPTARG";; + c) CLUSTERSIZE="$OPTARG";; h) usage;; ?) usage;; esac @@ -995,6 +1105,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" @@ -1021,11 +1134,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 @@ -1033,15 +1146,15 @@ 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 @@ -1059,35 +1172,35 @@ for tc in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do usage fi - 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 @@ -1097,15 +1210,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..d09a8f0 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 @@ -729,16 +733,26 @@ trap 'echo -ne "\n\n">>${RUN_LOG_FILE};echo "Interrupted by Ctrl+C,Cleanuping\ f_check $* +if [ "$BLOCKSIZE" != "NONE" ];then + bslist="$BLOCKSIZE" +else + bslist="512 1024 4096" +fi + +if [ "$CLUSTERSIZE" != "NONE" ];then + cslist="$CLUSTERSIZE" +else + cslist="4096 32768 1048576" +fi + START_TIME=${SECONDS} f_LogRunMsg ${RUN_LOG_FILE} "=====================Reflink tests start: `date`\ =====================\n" 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 +for BLOCKSIZE in $(echo "$bslist");do + for CLUSTERSIZE in $(echo "$cslist");do f_LogRunMsg ${RUN_LOG_FILE} "<- Running test with ${BLOCKSIZE} \ bs and ${CLUSTERSIZE} cs ->\n" f_LogMsg ${LOG_FILE} "<- Running test with ${BLOCKSIZE} bs \ diff --git a/programs/tunefs-test/tunefs-test.sh b/programs/tunefs-test/tunefs-test.sh index dc1bd1b..0fc3da3 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 } # @@ -512,8 +514,20 @@ Enable_Disable_Inline_Data() O_BLOCKSIZE=${BLOCKSIZE} O_CLUSTERSIZE=${CLUSTERSIZE} - for BLOCKSIZE in 512 1k 4k;do - for CLUSTERSIZE in 32k;do + if [ "$BLOCKSIZE" != "NONE" ];then + bslist="$BLOCKSIZE" + else + bslist="512 1k 4k" + fi + + if [ "$CLUSTERSIZE" != "NONE" ];then + cslist="$CLUSTERSIZE" + else + cslist="32k" + fi + + for BLOCKSIZE in $(echo "$bslist");do + for CLUSTERSIZE in $(echo "$cslist");do #set none inline-data support for volume LogMsg "tunefs_test : Enable/Disable Inline-data" @@ -647,12 +661,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 09044e1..1d3e8f7 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 @@ -1064,15 +1068,25 @@ trap ' : ' SIGTERM f_setup $* +if [ "$BLOCKSIZE" != "NONE" ];then + bslist="$BLOCKSIZE" +else + bslist="512 1024 2048 4096" +fi + +if [ "$CLUSTERSIZE" != "NONE" ];then + cslist="$CLUSTERSIZE" +else + cslist="4096 32768 1048576" +fi + 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 +for BLOCKSIZE in $(echo "$bslist") do -# for CLUSTERSIZE in 4096 32768 1048576 - for CLUSTERSIZE in 4096 1048576 + for CLUSTERSIZE in $(echo "$cslist") 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} -- 2.6.6
Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 10/17] Multiple run: make blocksize and clustersize as parameters
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/inline-data/multi-inline-run.sh | 24 ++++++++++++++++---- programs/python_common/multiple_run.sh | 28 +++++++++++++++++++----- programs/reflink_tests/multi_reflink_test_run.sh | 28 ++++++++++++++++++------ programs/xattr_tests/xattr-multi-run.sh | 24 ++++++++++++++++---- 4 files changed, 83 insertions(+), 21 deletions(-) diff --git a/programs/inline-data/multi-inline-run.sh b/programs/inline-data/multi-inline-run.sh index 1d51443..0a2ffa5 100755 --- a/programs/inline-data/multi-inline-run.sh +++ b/programs/inline-data/multi-inline-run.sh @@ -126,12 +126,14 @@ exit_or_not() ################################################################################ f_usage() { - echo "usage: `basename ${0}` [-r MPI_ranks] <-f MPI_hosts> [-a access_method] [-o output] <-d <device>> <mountpoint path>" + echo "usage: `basename ${0}` [-r MPI_ranks] <-f MPI_hosts> [-a access_method] [-o output] <-d <device>> <-b blocksize> -c <clustersize> <mountpoint path>" echo " -r size of MPI rank" echo " -a access method for process propagation,should be ssh or rsh,set ssh as a default method when omited." echo " -f MPI hosts list,separated by comma,e.g -f node1.us.oracle.com,node2.us.oracle.com." echo " -o output directory for the logs" echo " -d device name used for 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; @@ -144,13 +146,15 @@ f_getoptions() exit 1 fi - while getopts "o:hd:r:a:f:" options; do + while getopts "o:hd:r:a:f:b:c:" options; do case $options in a ) MPI_ACCESS_METHOD="$OPTARG";; r ) MPI_RANKS="$OPTARG";; f ) MPI_HOSTS="$OPTARG";; o ) LOG_OUT_DIR="$OPTARG";; d ) OCFS2_DEVICE="$OPTARG";; + b ) BLOCKSIZE="$OPTARG";; + c ) CLUSTERSIZE="$OPTARG";; h ) f_usage exit 1;; * ) f_usage @@ -327,9 +331,21 @@ trap ' : ' SIGTERM f_setup $* -for BLOCKSIZE in 512 1024 4096 +if [ -n "$BLOCKSIZE" ];then + bslist="$BLOCKSIZE" +else + bslist="512 1024 4096" +fi + +if [ -n "CLUSTERSIZE" ];then + cslist="$CLUSTERSIZE" +else + cslist="4096 32768 1048576" +fi + +for BLOCKSIZE in $(echo "$bslist") do - for CLUSTERSIZE in 4096 32768 1048576 + for CLUSTERSIZE in $(echo "$cslist") do echo "++++++++++Multiple node inline-data test with \"-b ${BLOCKSIZE} -C ${CLUSTERSIZE}\"++++++++++" |tee -a ${RUN_LOG_FILE} echo "++++++++++Multiple node inline-data test with \"-b ${BLOCKSIZE} -C ${CLUSTERSIZE}\"++++++++++">>${DATA_LOG_FILE} diff --git a/programs/python_common/multiple_run.sh b/programs/python_common/multiple_run.sh index 9e2237a..b2d5800 100755 --- a/programs/python_common/multiple_run.sh +++ b/programs/python_common/multiple_run.sh @@ -72,10 +72,12 @@ set -o pipefail ################################################################################ f_usage() { - echo "usage: `basename ${0}` <-k kerneltarball> <-n nodes> [-i nic] \ + echo "usage: `basename ${0}` <-k kerneltarball> [-b blocksize] [-c clustersize] <-n nodes> [-i nic] \ [-a access_method] [-o logdir] <-d device> [-t testcases] <mountpoint path>" echo " -k kerneltarball should be path of tarball for kernel src." echo " -n nodelist,should be comma separated." + echo " -b blocksize." + echo " -c clustersize." echo " -o output directory for the logs" echo " -i network interface name to be used for MPI messaging." echo " -a access method for mpi execution,should be ssh or rsh" @@ -97,13 +99,15 @@ f_getoptions() exit 1 fi - while getopts "n:d:i:a:o:k:t:h:" options; do + while getopts "n:d:i:a:o:b:c:k:t:h:" options; do case $options in n ) NODE_LIST="$OPTARG";; d ) DEVICE="$OPTARG";; i ) INTERFACE="$OPTARG";; a ) ACCESS_METHOD="$OPTARG";; o ) LOG_DIR="$OPTARG";; + b ) BLOCKSIZE="$OPTARG";; + c ) CLUSTERSIZE="$OPTARG";; k ) KERNELSRC="$OPTARG";; t ) TESTCASES="$OPTARG";; h ) f_usage @@ -359,7 +363,7 @@ run_xattr_test() LogRunMsg "xattr-test" ${BINDIR}/xattr-multi-run.sh -r 4 -f ${NODE_LIST} -a ssh -o ${logdir} \ --d ${DEVICE} ${MOUNT_POINT} >> ${LOGFILE} 2>&1 +-d ${DEVICE} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} ${MOUNT_POINT} >> ${LOGFILE} 2>&1 LogRC $? } @@ -369,7 +373,7 @@ run_inline_test() LogRunMsg "inline-test" ${BINDIR}/multi-inline-run.sh -r 2 -f ${NODE_LIST} -a ssh -o ${logdir} \ --d ${DEVICE} ${MOUNT_POINT} >> ${LOGFILE} 2>&1 +-d ${DEVICE} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} ${MOUNT_POINT} >> ${LOGFILE} 2>&1 LogRC $? } @@ -479,6 +483,18 @@ trap ' : ' SIGTERM f_setup $* +if [ -n "$BLOCKSIZE" ];then + bslist="$BLOCKSIZE" +else + bslist="512 1024 4096" +fi + +if [ -n "$CLUSTERSIZE" ];then + cslist="$CLUSTERSIZE" +else + cslist="4096 32768 1048576" +fi + STARTRUN=$(date +%s) ${ECHO} "`date` - Starting Multiple Nodes Regress test" > ${LOGFILE} @@ -498,8 +514,8 @@ for tc in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do run_reflink_test fi - for BLOCKSIZE in 512 1024 4096;do - for CLUSTERSIZE in 4096 32768 1048576;do + for BLOCKSIZE in $(echo "$bslist");do + for CLUSTERSIZE in $(echo "$cslist");do ${ECHO} "Tests with \"-b ${BLOCKSIZE} -C ${CLUSTERSIZE}\"" | \ ${TEE_BIN} -a ${LOGFILE} if [ "$tc"X = "write_append_truncate"X -o "$tc"X = "all"X ]; then diff --git a/programs/reflink_tests/multi_reflink_test_run.sh b/programs/reflink_tests/multi_reflink_test_run.sh index 682ea71..3dc0c68 100755 --- a/programs/reflink_tests/multi_reflink_test_run.sh +++ b/programs/reflink_tests/multi_reflink_test_run.sh @@ -90,12 +90,14 @@ set -o pipefail function f_usage() { echo "usage: `basename ${0}` [-r MPI_Ranks] <-f MPI_Hosts> \ -[-a access method] [-o logdir] <-d <device>> [-W] [-A] <mountpoint path>" +[-a access method] [-o logdir] <-d <device>> <-b block size> <-c cluster size> [-W] [-A] <mountpoint path>" echo " -r size of MPI rank" echo " -a access method for mpi execution,should be ssh or rsh" echo " -f MPI hosts list,separated by comma" echo " -o output directory for the logs" echo " -d specify the device" + echo " -b block size" + echo " -c cluster size" echo " -i Network Interface name to be used for MPI messaging." echo " -W enable data=writeback mode" echo " -A enable asynchronous io testing mode" @@ -110,7 +112,7 @@ function f_getoptions() exit 1 fi - while getopts "o:d:i:r:f:WAha:" options; do + while getopts "o:d:i:r:f:WAha:b:c:" options; do case $options in r ) MPI_RANKS="$OPTARG";; f ) MPI_HOSTS="$OPTARG";; @@ -118,6 +120,8 @@ function f_getoptions() d ) DEVICE="$OPTARG";; a ) MPI_ACCESS_METHOD="$OPTARG";; i ) INTERFACE="$OPTARG";; + b ) BLOCKSIZE="$OPTARG";; + c ) CLUSTERSIZE="$OPTARG";; W ) MOUNT_OPTS="data=writeback";; A ) AIO_OPT=" -A ";; h ) f_usage @@ -174,7 +178,7 @@ ${MOUNT_POINT}`" f_usage; } MPI_BTL_IF_ARG="-mca btl_tcp_if_include ${INTERFACE}" - fi; + fi MPI_RANKS=${MPI_RANKS:-$DEFAULT_RANKS} LOG_DIR=${LOG_DIR:-$DEFAULT_LOG_DIR} @@ -372,16 +376,26 @@ trap 'echo -ne "\n\n">>${RUN_LOG_FILE};echo "Interrupted by Ctrl+C,Cleanuping\ f_setup $* +if [ -n "$BLOCKSIZE" ];then + bslist="$BLOCKSIZE" +else + bslist="512 1024 2048 4096" +fi + +if [ -n "$CLUSTERSIZE" ];then + cslist="$CLUSTERSIZE" +else + cslist="4096 32768 1048576" +fi + START_TIME=${SECONDS} f_LogRunMsg ${RUN_LOG_FILE} "=====================Multi-nodes refcount tests \ start: `date`=====================\n" f_LogMsg ${LOG_FILE} "=====================Multi-nodes refcount tests \ start: `date`=====================" -#for BLOCKSIZE in 512 1024 2048 4096;do -# for CLUSTERSIZE in 4096 32768 1048576;do -for BLOCKSIZE in 4096;do - for CLUSTERSIZE in 1048576;do +for BLOCKSIZE in $(echo "$bslist");do + for CLUSTERSIZE in $(echo "$cslist");do f_LogRunMsg ${RUN_LOG_FILE} "<- Running test with ${BLOCKSIZE} \ bs and ${CLUSTERSIZE} cs ->\n" f_LogMsg ${LOG_FILE} "<- Running test with ${BLOCKSIZE} \ diff --git a/programs/xattr_tests/xattr-multi-run.sh b/programs/xattr_tests/xattr-multi-run.sh index 7b0f7e0..0a4f464 100755 --- a/programs/xattr_tests/xattr-multi-run.sh +++ b/programs/xattr_tests/xattr-multi-run.sh @@ -145,13 +145,15 @@ exit_or_not() ################################################################################ f_usage() { - echo "usage: `basename ${0}` [-r MPI_Ranks] <-f MPI_Hosts> [-a access method] [-o output] [-i interface] <-d <device>> <mountpoint path>" + echo "usage: `basename ${0}` [-r MPI_Ranks] <-f MPI_Hosts> [-a access method] [-o output] [-i interface] <-d <device>> <-b blocksize> <-c clustersize> <mountpoint path>" echo " -r size of MPI rank" echo " -a access method for process propagation,should be ssh or rsh,set ssh as a default method when omited." echo " -f MPI hosts list,separated by comma,e.g -f node1.us.oracle.com,node2.us.oracle.com." echo " -o output directory for the logs" echo " -i Network Interface name to be used for MPI messaging." 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; @@ -163,7 +165,7 @@ f_getoptions() exit 1 fi - while getopts "o:d:r:f:a:h:i:" options; do + while getopts "o:d:r:f:a:h:i:b:c:" options; do case $options in r ) MPI_RANKS="$OPTARG";; f ) MPI_HOSTS="$OPTARG";; @@ -171,6 +173,8 @@ f_getoptions() d ) OCFS2_DEVICE="$OPTARG";; a ) MPI_ACCESS_METHOD="$OPTARG";; i ) INTERFACE="$OPTARG";; + b ) BLOCKSIZE="$OPTARG";; + c ) CLUSTERSIZE="$OPTARG";; h ) f_usage exit 1;; * ) f_usage @@ -467,13 +471,25 @@ trap ' : ' SIGTERM f_setup $* +if [ -n "$BLOCKSIZE" ];then + bslist="$BLOCKSIZE" +else + bslist="512 4096" +fi + +if [ -n "$CLUSTERSIZE" ];then + cslist="$CLUSTERSIZE" +else + cslist="4096 1048576" +fi + START_TIME=${SECONDS} echo "=====================Multiple nodes xattr testing starts: `date`=====================" |tee -a ${RUN_LOG_FILE} echo "=====================Multiple nodes xattr testing starts: `date`=====================" >> ${LOG_FILE} -for BLOCKSIZE in 512 4096 +for BLOCKSIZE in $(echo "$bslist") do - for CLUSTERSIZE in 4096 1048576 + for CLUSTERSIZE in $(echo "$cslist") do echo "++++++++++xattr tests with \"-b ${BLOCKSIZE} -C ${CLUSTERSIZE}\"++++++++++" |tee -a ${RUN_LOG_FILE} echo "++++++++++xattr tests with \"-b ${BLOCKSIZE} -C ${CLUSTERSIZE}\"++++++++++">>${LOG_FILE} -- 2.6.6
Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 11/17] discontig bg: make blocksize and clustersize as parameters
Add "-b blocksize" and "-c clustersize" as optional parameters. It will keep the original behavior if we don't specify their values. Signed-off-by: Eric Ren <zren at suse.com> --- programs/discontig_bg_test/discontig_runner.sh | 51 +++++++++++++++++--------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/programs/discontig_bg_test/discontig_runner.sh b/programs/discontig_bg_test/discontig_runner.sh index bb6a53e..1d94be3 100755 --- a/programs/discontig_bg_test/discontig_runner.sh +++ b/programs/discontig_bg_test/discontig_runner.sh @@ -64,7 +64,8 @@ MPI_BTL_IF_ARG ################################################################################ function f_usage() { - echo "usage: `basename ${0}` <-d device> [-o logdir] [-m multi_hosts] [-a access_method] <mount point>" + echo "usage: `basename ${0}` <-d device> [-o logdir] [-m multi_hosts] [-a access_method] \ +[-b block_size] [-c cluster_size] <mount point>" exit 1; } @@ -76,13 +77,15 @@ function f_getoptions() exit 1 fi - while getopts "hd:o:m:a:" options; do + while getopts "hd:o:m:a:b:c:" options; do case $options in d ) DEVICE="$OPTARG";; o ) LOG_DIR="$OPTARG";; a ) MPI_ACCESS_METHOD="$OPTARG";; m ) MULTI_TEST=1 MPI_HOSTS="$OPTARG";; + b ) BLOCKSIZE="$OPTARG";; + c ) CLUSTERSIZE="$OPTARG";; h ) f_usage exit 1;; * ) f_usage @@ -209,7 +212,7 @@ function f_inodes_test() local filename f_LogMsg ${LOG_FILE} "Activate inode discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t inode -r 200 -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t inode -r 200 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -292,7 +295,7 @@ function f_inodes_test() f_exit_or_not ${RET} f_LogMsg ${LOG_FILE} "[*] Activate inode discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t inode -r 4096 -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t inode -r 4096 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -420,7 +423,7 @@ function f_extents_test() local inc f_LogMsg ${LOG_FILE} "[*] Activate extent discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t extent -r 2048 -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t extent -r 2048 -b ${BLOCKSIZE}-c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -552,7 +555,7 @@ function f_extents_test() function f_inline_test() { f_LogMsg ${LOG_FILE} "[*] Activate inode discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t inode -r 1024 -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t inode -r 1024 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -622,7 +625,7 @@ function f_inline_test() function f_xattr_test() { f_LogMsg ${LOG_FILE} "[*] Activate extent discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t extent -r 10240 -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t extent -r 10240 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -705,7 +708,7 @@ function f_refcount_test() local inc f_LogMsg ${LOG_FILE} "[*] Activate extent discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -883,7 +886,7 @@ function f_refcount_test() function f_dxdir_test() { f_LogMsg ${LOG_FILE} "[*] Activate inode discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t extents -r 2048 -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t extents -r 2048 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -965,7 +968,7 @@ function f_multi_inodes_test() { f_LogMsg ${LOG_FILE} "Activate inode discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t inode -r 800 -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t inode -r 800 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -1014,8 +1017,8 @@ function f_multi_extents_test() local filename f_LogMsg ${LOG_FILE} "Activate extents discontig-bg on ${DEVICE}" - f_LogMsg ${LOG_FILE} "CMD: ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT}" - ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + f_LogMsg ${LOG_FILE} "CMD: ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT}" + ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -1070,8 +1073,8 @@ function f_multi_xattr_test() local remain_space=1024 f_LogMsg ${LOG_FILE} "Activate extents discontig-bg on ${DEVICE}" - f_LogMsg ${LOG_FILE} "CMD: ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT}" - ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + f_LogMsg ${LOG_FILE} "CMD: ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT}" + ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -1136,8 +1139,8 @@ function f_multi_refcount_test() local remain_space=1024 f_LogMsg ${LOG_FILE} "Activate extents discontig-bg on ${DEVICE}" - f_LogMsg ${LOG_FILE} "CMD: ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT}" - ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b $BLOCKSIZE -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + f_LogMsg ${LOG_FILE} "CMD: ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT}" + ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -1255,13 +1258,25 @@ trap 'echo -ne "\n\n">>${RUN_LOG_FILE};echo "Interrupted by Ctrl+C,Cleanuping\ f_setup $* +if [ -z ${BLOCKSIZE} ];then + bslist="512 4096" +else + bslist=${BLOCKSIZE} +fi + +if [ -z ${CLUSTERSIZE} ];then + cslist="4096 8192" +else + cslist=${CLUSTERSIZE} +fi + f_LogRunMsg ${RUN_LOG_FILE} "=====================Discontiguous block group test starts: `date`\ =====================\n" f_LogMsg ${LOG_FILE} "=====================Discontiguous block groups tests start: `date`\ =====================" -for BLOCKSIZE in 512 4096;do - for CLUSTERSIZE in 4096 8192;do +for BLOCKSIZE in $(echo "$bslist");do + for CLUSTERSIZE in $(echo "$cslist");do f_LogRunMsg ${RUN_LOG_FILE} "<- Running test with ${BLOCKSIZE} \ bs and ${CLUSTERSIZE} cs ->\n" f_LogMsg ${LOG_FILE} "<- Running test with ${BLOCKSIZE} bs \ -- 2.6.6
Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 12/17] Add two cluster-aware parameters: cluster stack and cluster name
With pacemaker as cluster stack, single node test always fail on mkfs in some testcases. On suse OS, we use pcmk plugin as default cluster stack. But in single node test, some testcases format ocfs2 volume as local filesystem. In such case, o2cb plugin is used. If the next testcase want to format the volume with multiple slots, it will fail because mkfs.ocfs2 cannot shift from o2cb to pcmk automatically. This patch should be merged into suse branch, without affecting other OS release only using o2cb. Signed-off-by: Eric Ren <zren at suse.com> --- programs/backup_super/test_backup_super.sh | 27 ++++++-- .../discontig_bg_test/activate_discontig_bg.sh | 12 ++-- programs/discontig_bg_test/discontig_runner.sh | 36 ++++++----- programs/inline-data/multi-inline-run.sh | 13 ++-- programs/inline-data/single-inline-run.sh | 10 ++- programs/mkfs-tests/mkfs-test.sh | 46 ++++++++----- programs/python_common/multiple_run.sh | 22 ++++--- programs/python_common/o2tf.sh | 16 ++++- programs/python_common/single_run-WIP.sh | 75 ++++++++++++++-------- programs/reflink_tests/multi_reflink_test_run.sh | 12 +++- programs/reflink_tests/reflink_test_run.sh | 8 ++- programs/tunefs-test/tunefs-test.sh | 11 ++-- programs/xattr_tests/xattr-multi-run.sh | 15 ++++- programs/xattr_tests/xattr-single-run.sh | 13 ++-- 14 files changed, 215 insertions(+), 101 deletions(-) diff --git a/programs/backup_super/test_backup_super.sh b/programs/backup_super/test_backup_super.sh index 530109e..05da3e7 100755 --- a/programs/backup_super/test_backup_super.sh +++ b/programs/backup_super/test_backup_super.sh @@ -169,7 +169,8 @@ function test_mkfs() msg1="debugfs should be sucess" blkcount=`expr $vol_byte_size / $blocksize` - echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4 -J size=64M ${DEVICE} $blkcount + echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4 -J size=64M \ + --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} ${DEVICE} $blkcount #first check whether mkfs is success echo "ls //"|${DEBUGFS_BIN} ${DEVICE}|grep global_bitmap exit_if_bad $? 0 $msg $LINENO @@ -186,7 +187,8 @@ function test_mkfs() ${DD_BIN} if=/dev/zero of=$DEVICE bs=4096 count=3 clear_backup_blocks - echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4 -J size=64M ${DEVICE} $blkcount + echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4 -J size=64M \ + --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} ${DEVICE} $blkcount #first check whether mkfs is success echo "ls //"|${DEBUGFS_BIN} ${DEVICE}|grep global_bitmap exit_if_bad $? 0 $msg1 $LINENO @@ -217,7 +219,8 @@ function test_fsck() ${DD_BIN} if=/dev/zero of=$DEVICE bs=4096 count=3 clear_backup_blocks - echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4 -J size=64M ${DEVICE} $blkcount + echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4 -J size=64M \ + --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} ${DEVICE} $blkcount #corrupt the superblock ${DD_BIN} if=/dev/zero of=${DEVICE} bs=$blocksize count=3 ${FSCK_BIN} -fy ${DEVICE} #This should failed. @@ -247,7 +250,8 @@ function test_tunefs_resize() clear_backup_blocks #mkfs a volume with no backup superblock - echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4 -J size=64M ${DEVICE} $blkcount + echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4 -J size=64M \ + --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} ${DEVICE} $blkcount local bpc=`expr $clustersize / $blocksize` local blkcount=`expr $blkcount + $bpc` @@ -283,7 +287,8 @@ function test_tunefs_add_backup() clear_backup_blocks #mkfs a volume with no backup superblock supported - echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4 -J size=64M --no-backup-super ${DEVICE} $blkcount + echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4 -J size=64M --no-backup-super \ + --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} ${DEVICE} $blkcount #We can't open the volume by backup superblock now echo "ls //"|${DEBUGFS_BIN} ${DEVICE} -s 1|grep global_bitmap @@ -327,7 +332,8 @@ function test_tunefs_refresh() local old_vol_name="old_ocfs2" local new_vol_name="new_ocfs2" - echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4 -J size=64M -L $old_vol_name ${DEVICE} $blkcount + echo "y" |${MKFS_BIN} -b $blocksize -C $clustersize -N 4 -J size=64M -L $old_vol_name \ + --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} ${DEVICE} $blkcount check_vol $old_vol_name #change the volume name @@ -365,7 +371,8 @@ function volume_small_test() # Since tunefs will return 0, we need to grep # the output of stderr and find what we want. - echo "y" |${MKFS_BIN} -b 1K -C 4K ${DEVICE} -N 4 --no-backup-super $tmp_block_count + echo "y" |${MKFS_BIN} -b 1K -C 4K ${DEVICE} -N 4 --no-backup-super $tmp_block_count \ + --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} err=`${TUNEFS_BIN} --backup-super ${DEVICE} 2>&1` echo $err|grep "too small to contain backup superblocks" exit_if_bad $? 0 "tunefs.ocfs2" $LINENO @@ -465,6 +472,12 @@ do "--log-dir="*) LOG_DIR="${1#--log-dir=}" ;; + "--cluster-stack="*) + CLUSTER_STACK="${1#--cluster-stack=}" + ;; + "--cluster-name="*) + CLUSTER_NAME="${1#--cluster-name=}" + ;; "--with-fsck="*) FSCK_BIN="${1#--with-fsck=}" ;; diff --git a/programs/discontig_bg_test/activate_discontig_bg.sh b/programs/discontig_bg_test/activate_discontig_bg.sh index 6b4e07f..d44d479 100755 --- a/programs/discontig_bg_test/activate_discontig_bg.sh +++ b/programs/discontig_bg_test/activate_discontig_bg.sh @@ -21,6 +21,8 @@ fi DEVICE MOUNT_POINT+CLUSTER_STACK+CLUSTER_NAME WORK_PLACE WORK_PLACE_DIRENT=ocfs2-activate-discontig-bg-dir TUNEFS_BIN="`which sudo` -u root `which tunefs.ocfs2`" @@ -69,7 +71,7 @@ function f_usage() { echo "usage: `basename ${0}` [-t type] [-r resv_size] [-b blocksize] \ [-c clustersize] [-l label] [-m mpi_hosts] [-a access_method] <-d device> \ -[-o logdir] <mount point> " +[-o logdir] <-s cluster stack> <-n cluster name> <mount point>" exit 1; } @@ -80,8 +82,8 @@ function f_getoptions() f_usage; exit 1 fi - - while getopts "hd:o:b:c:t:r:l:m:a:" options; do + + while getopts "hd:o:b:c:t:r:l:m:a:s:n:" options; do case $options in d ) DEVICE="$OPTARG";; o ) LOG_DIR="$OPTARG";; @@ -93,6 +95,8 @@ function f_getoptions() a ) MPI_ACCESS_METHOD="$OPTARG";; m ) MULTI_TEST=1 MPI_HOSTS="$OPTARG";; + s ) CLUSTER_STACK="$OPTARG";; + n ) CLUSTER_NAME="$OPTARG";; h ) f_usage exit 1;; * ) f_usage @@ -325,7 +329,7 @@ function f_activate_discontig() f_LogRunMsg ${RUN_LOG_FILE} "[*] Mkfs device ${DEVICE}:" f_mkfs ${LOG_FILE} ${BLOCKSIZE} ${CLUSTERSIZE} ${LABELNAME} ${SLOTS} \ -${DEVICE} "refcount,xattr,metaecc,discontig-bg" ${JOURNALSIZE} ${ORIG_VOLUME_SIZE_BK} +${DEVICE} "refcount,xattr,metaecc,discontig-bg" ${JOURNALSIZE} ${ORIG_VOLUME_SIZE_BK} ${CLUSTER_STACK} ${CLUSTER_NAME} RET=$? f_echo_status ${RET}| tee -a ${RUN_LOG_FILE} f_exit_or_not ${RET} diff --git a/programs/discontig_bg_test/discontig_runner.sh b/programs/discontig_bg_test/discontig_runner.sh index 1d94be3..3be39c8 100755 --- a/programs/discontig_bg_test/discontig_runner.sh +++ b/programs/discontig_bg_test/discontig_runner.sh @@ -19,6 +19,8 @@ fi DEVICE MOUNT_POINT+CLUSTER_STACK+CLUSTER_NAME WORK_PLACE WORK_PLACE_DIRENT=ocfs2-discontig-bg-test DISCONTIG_ACTIVATE_BIN="${BINDIR}/activate_discontig_bg.sh" @@ -65,7 +67,7 @@ MPI_BTL_IF_ARG function f_usage() { echo "usage: `basename ${0}` <-d device> [-o logdir] [-m multi_hosts] [-a access_method] \ -[-b block_size] [-c cluster_size] <mount point>" +[-b block_size] [-c cluster_size] <-s cluster stack> <-n cluster name> <mount point>" exit 1; } @@ -77,7 +79,7 @@ function f_getoptions() exit 1 fi - while getopts "hd:o:m:a:b:c:" options; do + while getopts "hd:o:m:a:b:c:s:n:" options; do case $options in d ) DEVICE="$OPTARG";; o ) LOG_DIR="$OPTARG";; @@ -86,6 +88,8 @@ function f_getoptions() MPI_HOSTS="$OPTARG";; b ) BLOCKSIZE="$OPTARG";; c ) CLUSTERSIZE="$OPTARG";; + s ) CLUSTER_STACK="$OPTARG";; + n ) CLUSTER_NAME="$OPTARG";; h ) f_usage exit 1;; * ) f_usage @@ -212,7 +216,7 @@ function f_inodes_test() local filename f_LogMsg ${LOG_FILE} "Activate inode discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t inode -r 200 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t inode -r 200 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -295,7 +299,7 @@ function f_inodes_test() f_exit_or_not ${RET} f_LogMsg ${LOG_FILE} "[*] Activate inode discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t inode -r 4096 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t inode -r 4096 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -423,7 +427,7 @@ function f_extents_test() local inc f_LogMsg ${LOG_FILE} "[*] Activate extent discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t extent -r 2048 -b ${BLOCKSIZE}-c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t extent -r 2048 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -555,7 +559,7 @@ function f_extents_test() function f_inline_test() { f_LogMsg ${LOG_FILE} "[*] Activate inode discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t inode -r 1024 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t inode -r 1024 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -625,7 +629,7 @@ function f_inline_test() function f_xattr_test() { f_LogMsg ${LOG_FILE} "[*] Activate extent discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t extent -r 10240 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t extent -r 10240 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -708,7 +712,7 @@ function f_refcount_test() local inc f_LogMsg ${LOG_FILE} "[*] Activate extent discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -886,7 +890,7 @@ function f_refcount_test() function f_dxdir_test() { f_LogMsg ${LOG_FILE} "[*] Activate inode discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t extents -r 2048 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t extents -r 2048 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -968,7 +972,7 @@ function f_multi_inodes_test() { f_LogMsg ${LOG_FILE} "Activate inode discontig-bg on ${DEVICE}" - ${DISCONTIG_ACTIVATE_BIN} -t inode -r 800 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + ${DISCONTIG_ACTIVATE_BIN} -t inode -r 800 -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -1017,8 +1021,8 @@ function f_multi_extents_test() local filename f_LogMsg ${LOG_FILE} "Activate extents discontig-bg on ${DEVICE}" - f_LogMsg ${LOG_FILE} "CMD: ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT}" - ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + f_LogMsg ${LOG_FILE} "CMD: ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT}" + ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -1073,8 +1077,8 @@ function f_multi_xattr_test() local remain_space=1024 f_LogMsg ${LOG_FILE} "Activate extents discontig-bg on ${DEVICE}" - f_LogMsg ${LOG_FILE} "CMD: ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT}" - ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + f_LogMsg ${LOG_FILE} "CMD: ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT}" + ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} @@ -1139,8 +1143,8 @@ function f_multi_refcount_test() local remain_space=1024 f_LogMsg ${LOG_FILE} "Activate extents discontig-bg on ${DEVICE}" - f_LogMsg ${LOG_FILE} "CMD: ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT}" - ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 + f_LogMsg ${LOG_FILE} "CMD: ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT}" + ${DISCONTIG_ACTIVATE_BIN} -t extent -r ${remain_space} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -d ${DEVICE} -o ${LOG_DIR} -l ${LABELNAME} -m ${MPI_HOSTS} -a ${MPI_ACCESS_METHOD} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >>${LOG_FILE} 2>&1 RET=$? f_exit_or_not ${RET} diff --git a/programs/inline-data/multi-inline-run.sh b/programs/inline-data/multi-inline-run.sh index 0a2ffa5..f7b0bf8 100755 --- a/programs/inline-data/multi-inline-run.sh +++ b/programs/inline-data/multi-inline-run.sh @@ -50,6 +50,8 @@ DATA_LOG_FILE DIRS_LOG_FILE RUN_LOG_FILE MOUNT_POINT+CLUSTER_STACK+CLUSTER_NAME OCFS2_DEVICE OCFS2_UUID @@ -126,7 +128,7 @@ exit_or_not() ################################################################################ f_usage() { - echo "usage: `basename ${0}` [-r MPI_ranks] <-f MPI_hosts> [-a access_method] [-o output] <-d <device>> <-b blocksize> -c <clustersize> <mountpoint path>" + echo "usage: `basename ${0}` [-r MPI_ranks] <-f MPI_hosts> [-a access_method] [-o output] <-d <device>> <-b blocksize> -c <clustersize> <-s <cluster-stack>> <-n <cluster-name>> <mountpoint path>" echo " -r size of MPI rank" echo " -a access method for process propagation,should be ssh or rsh,set ssh as a default method when omited." echo " -f MPI hosts list,separated by comma,e.g -f node1.us.oracle.com,node2.us.oracle.com." @@ -134,9 +136,10 @@ f_usage() echo " -d device name used for ocfs2 volume" echo " -b block size" echo " -c cluster size" + echo " -s cluster stack" + echo " -n cluster name" echo " <mountpoint path> path of mountpoint where the ocfs2 volume will be mounted on." exit 1; - } f_getoptions() @@ -146,7 +149,7 @@ f_getoptions() exit 1 fi - while getopts "o:hd:r:a:f:b:c:" options; do + while getopts "o:hd:r:a:f:b:c:s:n:" options; do case $options in a ) MPI_ACCESS_METHOD="$OPTARG";; r ) MPI_RANKS="$OPTARG";; @@ -155,6 +158,8 @@ f_getoptions() d ) OCFS2_DEVICE="$OPTARG";; b ) BLOCKSIZE="$OPTARG";; c ) CLUSTERSIZE="$OPTARG";; + s ) CLUSTER_STACK="$OPTARG";; + n ) CLUSTER_NAME="$OPTARG";; h ) f_usage exit 1;; * ) f_usage @@ -212,7 +217,7 @@ f_do_mkfs_and_mount() { echo -n "Mkfsing device(-b ${BLOCKSIZE} -C ${CLUSTERSIZE}): "|tee -a ${RUN_LOG_FILE} - echo y|${MKFS_BIN} --fs-features=inline-data -b ${BLOCKSIZE} -C ${CLUSTERSIZE} -N 4 -L ocfs2-inline-test ${OCFS2_DEVICE} ${BLOCKNUMS}>>${RUN_LOG_FILE} 2>&1 + echo y|${MKFS_BIN} --fs-features=inline-data -b ${BLOCKSIZE} -C ${CLUSTERSIZE} --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} -N 4 -L ocfs2-inline-test ${OCFS2_DEVICE} ${BLOCKNUMS}>>${RUN_LOG_FILE} 2>&1 RET=$? echo_status ${RET} |tee -a ${RUN_LOG_FILE} diff --git a/programs/inline-data/single-inline-run.sh b/programs/inline-data/single-inline-run.sh index 89b2f4c..92a0317 100755 --- a/programs/inline-data/single-inline-run.sh +++ b/programs/inline-data/single-inline-run.sh @@ -105,11 +105,13 @@ exit_or_not() ################################################################################ f_usage() { - echo "usage: `basename ${0}` [-o output] <-b blocksize> <-c clustersize> <-d <device>> <mountpoint path>" + echo "usage: `basename ${0}` [-o output] <-b blocksize> <-c clustersize> <-d <device>> <-s <cluster stack>> <-n <cluster name>> <mountpoint path>" echo " -o output directory for the logs" echo " -b blocksize" echo " -c clustersize" echo " -d device name used for ocfs2 volume" + echo " -s cluster stack" + echo " -n cluster name" echo " <mountpoint path> path of mountpoint where the ocfs2 volume will be mounted on." exit 1; @@ -122,12 +124,14 @@ f_getoptions() exit 1 fi - while getopts "o:hd:b:c:" options; do + while getopts "o:hd:b:c:s:n:" options; do case $options in o ) LOG_OUT_DIR="$OPTARG";; d ) OCFS2_DEVICE="$OPTARG";; b ) BLOCKSIZE="$OPTARG";; c ) CLUSTERSIZE="$OPTARG";; + s ) CLUSTER_STACK="$OPTARG";; + n ) CLUSTER_NAME="$OPTARG";; h ) f_usage exit 1;; * ) f_usage @@ -174,7 +178,7 @@ f_do_mkfs_and_mount() { echo -n "Mkfsing device:"|tee -a ${RUN_LOG_FILE} - echo y|${MKFS_BIN} --fs-features=inline-data -b ${BLOCKSIZE} -C ${CLUSTERSIZE} -N 4 ${OCFS2_DEVICE} ${BLOCKNUMS} >>${RUN_LOG_FILE} 2>&1 + echo y|${MKFS_BIN} --fs-features=inline-data --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} -b ${BLOCKSIZE} -C ${CLUSTERSIZE} -N 4 ${OCFS2_DEVICE} ${BLOCKNUMS} >>${RUN_LOG_FILE} 2>&1 RET=$? echo_status ${RET} |tee -a ${RUN_LOG_FILE} exit_or_not ${RET} diff --git a/programs/mkfs-tests/mkfs-test.sh b/programs/mkfs-tests/mkfs-test.sh index 67299ac..2a3f4b7 100755 --- a/programs/mkfs-tests/mkfs-test.sh +++ b/programs/mkfs-tests/mkfs-test.sh @@ -3,12 +3,14 @@ # mkfs_test -o <outdir> -d <device> -b <blocksize> -c <clustersize> # usage() { - echo "usage: ${MKFS_TEST} -o <outdir> -d <device> -m <mountpoint> -b <blocksize> -c <clustersize>" + echo "usage: ${MKFS_TEST} -o <outdir> -d <device> -m <mountpoint> -b <blocksize> -c <clustersize> -s <cluster-stack> -n <cluster-name>" echo " -o output directory for the logs" echo " -d device" echo " -m mountpoint" echo " -b blocksize" echo " -c clustersize" + echo " -s cluster stack" + echo " -n cluster name" exit 1 } @@ -107,8 +109,8 @@ do_fsck() { } do_mkfs() { - if [ "$#" -lt "5" ] ; then - echo "do_mkfs(): blocksize clustersize device volsize out" |tee -a ${LOGFILE} + if [ "$#" -lt "7" ] ; then + echo "do_mkfs(): blocksize clustersize device volsize out cluster-stack cluster-name" |tee -a ${LOGFILE} exit 1 fi @@ -117,11 +119,13 @@ do_mkfs() { D=$3 V=$4 O=$5 + S=$6 + N=$7 - echo ${MKFS} -b ${B} -C ${C} ${D} ${V} >> ${LOGFILE} + echo ${MKFS} -b ${B} -C ${C} ${D} ${V} --cluster-stack=${S} --cluster-name=${N} >> ${LOGFILE} echo -n "mkfs ..... " |tee -a ${LOGFILE} - echo ${MKFS} -b ${B} -C ${C} ${D} ${V} >> ${O} - ${MKFS} -x -F -b ${B} -C ${C} -N 1 -J size=4M ${D} ${V} >> ${O} 2>&1 + echo ${MKFS} -b ${B} -C ${C} ${D} ${V} --cluster-stack=${S} --cluster-name=${N} >> ${O} + ${MKFS} -x -F -b ${B} -C ${C} -N 1 -J size=4M ${D} ${V} --cluster-stack=${S} --cluster-name=${N} >> ${O} 2>&1 echo "OK" |tee -a ${LOGFILE} echo "" >> ${O} } @@ -260,7 +264,7 @@ mntdir blocksize clustersize OPTIND=1 -while getopts "d:i:o:m:c:b:" args +while getopts "d:i:o:m:c:b:s:n:" args do case "$args" in o) outdir="$OPTARG";; @@ -268,6 +272,8 @@ do m) mntdir="$OPTARG";; b) blocksize="$OPTARG";; c) clustersize="$OPTARG";; + s) cluster_stack="$OPTARG";; + n) cluster_name="$OPTARG";; esac done LOGFILE=${outdir}/mkfs-test.log @@ -290,6 +296,16 @@ if [ -z "${mntdir}" ]; then usage ; fi +if [ -z "${cluster_stack}" ]; then + echo "invalid cluster stack: ${cluster_stack}" |tee -a ${LOGFILE} + usage ; +fi + +if [ -z "${cluster_name}" ]; then + echo "invalid cluster name: ${cluster_name}" |tee -a ${LOGFILE} + usage ; +fi + echo "create logdir ${outdir}" |tee -a ${LOGFILE} mkdir -p ${outdir} @@ -326,7 +342,7 @@ do fi; echo "Test ${testnum}: -b ${blks} -C ${clusts}" |tee -a ${LOGFILE} - do_mkfs ${blks} ${clusts} ${device} ${numblks} ${OUT} + do_mkfs ${blks} ${clusts} ${device} ${numblks} ${OUT} ${cluster_stack} ${cluster_name} verify_sizes ${blks} ${clusts} ${numblks} ${OUT} do_fsck ${OUT} testnum=$[$testnum+1] @@ -366,7 +382,7 @@ if [ -f ${OUT} ]; then fi; echo "Test ${testnum}: -T datafiles" |tee -a ${LOGFILE} echo -n "mkfs ..... " |tee -a ${LOGFILE} -${MKFS} -x -F -b 4K -C 4K -N 2 -T datafiles ${device} 262144 >${OUT} 2>&1 +${MKFS} -x -F -b 4K -C 4K -N 2 -T datafiles ${device} --cluster-stack=${S} --cluster-name=${N} 262144 >${OUT} 2>&1 echo "OK" |tee -a ${LOGFILE} echo -n "verify ..... " |tee -a ${LOGFILE} ${DEBUGFS} -R "ls -l //" ${device} >>${OUT} 2>&1 @@ -393,7 +409,7 @@ do fi; echo "Test ${testnum}: -J size=${jrnlsz}M" |tee -a ${LOGFILE} echo -n "mkfs ..... " |tee -a ${LOGFILE} - ${MKFS} -x -F -b 4K -C 4K -N 2 -J size=${jrnlsz}M ${device} 262144 >${OUT} 2>&1 + ${MKFS} -x -F -b 4K -C 4K -N 2 -J size=${jrnlsz}M ${device} --cluster-stack=${S} --cluster-name=${N} 262144 >${OUT} 2>&1 echo "OK" |tee -a ${LOGFILE} echo -n "verify ..... " |tee -a ${LOGFILE} ${DEBUGFS} -R "ls -l //" ${device} >>${OUT} 2>&1 @@ -422,7 +438,7 @@ do fi; echo "Test ${testnum}: -N ${slots}" |tee -a ${LOGFILE} echo -n "mkfs ..... " |tee -a ${LOGFILE} - ${MKFS} -x -F -b 4K -C 4K -N ${slots} -J size=4M ${device} 262144 >${OUT} 2>&1 + ${MKFS} -x -F -b 4K -C 4K -N ${slots} -J size=4M ${device} --cluster-stack=${S} --cluster-name=${N} 262144 >${OUT} 2>&1 echo "OK" |tee -a ${LOGFILE} echo -n "verify ..... " |tee -a ${LOGFILE} ${DEBUGFS} -R "stats" ${device} >>${OUT} 2>&1 @@ -448,7 +464,7 @@ fi; echo "Test ${testnum}: -L mylabel" |tee -a ${LOGFILE} label="my_label_is_very_very_very_long_to_the_point_of_being_useless" echo -n "mkfs ..... " |tee -a ${LOGFILE} -${MKFS} -x -F -b 4K -C 4K -N 1 -L ${label} ${device} 262144 >${OUT} 2>&1 +${MKFS} -x -F -b 4K -C 4K -N 1 -L ${label} ${device} --cluster-stack=${S} --cluster-name=${N} 262144 >${OUT} 2>&1 echo "OK" |tee -a ${LOGFILE} echo -n "verify ..... " |tee -a ${LOGFILE} ${DEBUGFS} -R "stats" ${device} >${OUT} 2>&1 @@ -473,7 +489,7 @@ fi; echo "Test ${testnum}: --fs-features=inline-data" |tee -a ${LOGFILE} label="Oracle_Home" echo -n "mkfs ..... " |tee -a ${LOGFILE} -${MKFS} --fs-features=inline-data -x -F -b 4K -C 4K -N 2 -L ${label} ${device} 262144 >>${OUT} 2>&1 +${MKFS} --fs-features=inline-data -x -F -b 4K -C 4K -N 2 -L ${label} ${device} --cluster-stack=${S} --cluster-name=${N} 262144 >>${OUT} 2>&1 echo "OK" |tee -a ${LOGFILE} echo -n "verify ..... " |tee -a ${LOGFILE} ${DEBUGFS} -R "stats" ${device} >>${OUT} 2>&1 @@ -499,7 +515,7 @@ fi; echo "Test ${testnum}: Default option for sparse file support" |tee -a ${LOGFILE} label="Oracle_Home" echo -n "mkfs ..... " |tee -a ${LOGFILE} -${MKFS} -x -F -b 4K -C 4K -N 2 -L ${label} ${device} 262144 >>${OUT} 2>&1 +${MKFS} -x -F -b 4K -C 4K -N 2 -L ${label} ${device} --cluster-stack=${S} --cluster-name=${N} 262144 >>${OUT} 2>&1 echo "OK" |tee -a ${LOGFILE} echo -n "verify ..... " |tee -a ${LOGFILE} ${DEBUGFS} -R "stats" ${device} >>${OUT} 2>&1 @@ -533,7 +549,7 @@ then fi echo "Test ${testnum}: bitmap_cpg change" |tee -a ${LOGFILE} echo -n "mkfs ..... " |tee -a ${LOGFILE} -${MKFS} -x -F -b ${blocksz} -C ${clustsz} -N 2 ${device} ${blkcount} >${OUT} 2>&1 +${MKFS} -x -F -b ${blocksz} -C ${clustsz} -N 2 ${device} --cluster-stack=${S} --cluster-name=${N} ${blkcount} >${OUT} 2>&1 echo "OK" |tee -a ${LOGFILE} #consume the whole volume and then delete all the files. diff --git a/programs/python_common/multiple_run.sh b/programs/python_common/multiple_run.sh index b2d5800..3e52eff 100755 --- a/programs/python_common/multiple_run.sh +++ b/programs/python_common/multiple_run.sh @@ -43,6 +43,8 @@ REMOTE_UMOUNT_BIN="${BINDIR}/remote_umount.py" NODE_LIST DEVICE MOUNT_POINT+CLUSTER_STACK+CLUSTER_NAME KERNELSRC ACCESS_METHOD="ssh" @@ -73,7 +75,7 @@ set -o pipefail f_usage() { echo "usage: `basename ${0}` <-k kerneltarball> [-b blocksize] [-c clustersize] <-n nodes> [-i nic] \ -[-a access_method] [-o logdir] <-d device> [-t testcases] <mountpoint path>" +[-a access_method] [-o logdir] <-d device> [-t testcases] [-s stack name] [-C cluster name] <mountpoint path>" echo " -k kerneltarball should be path of tarball for kernel src." echo " -n nodelist,should be comma separated." echo " -b blocksize." @@ -83,6 +85,8 @@ f_usage() echo " -a access method for mpi execution,should be ssh or rsh" echo " -d device name used for ocfs2 volume." echo " -t sepcify testcases to run." + echo " -s cluster stack." + echo " -C cluster name." echo " <mountpoint path> path of mountpoint where test will be performed." echo echo "Eaxamples:" @@ -99,7 +103,7 @@ f_getoptions() exit 1 fi - while getopts "n:d:i:a:o:b:c:k:t:h:" options; do + while getopts "n:d:i:a:o:k:b:c:t:s:C:h:" options; do case $options in n ) NODE_LIST="$OPTARG";; d ) DEVICE="$OPTARG";; @@ -110,6 +114,8 @@ f_getoptions() c ) CLUSTERSIZE="$OPTARG";; k ) KERNELSRC="$OPTARG";; t ) TESTCASES="$OPTARG";; + s ) CLUSTER_STACK="$OPTARG";; + C ) CLUSTER_NAME="$OPTARG";; h ) f_usage exit 1;; * ) f_usage @@ -280,7 +286,7 @@ run_common_testcase() LogMsg "Mkfs device ${DEVICE}:" f_mkfs ${LOGFILE} ${BLOCKSIZE} ${CLUSTERSIZE} ${LABELNAME} ${SLOTS} \ -${DEVICE} ${FEATURES} ${JOURNALSIZE} ${BLOCKS} +${DEVICE} ${FEATURES} ${JOURNALSIZE} ${BLOCKS} ${CLUSTER_STACK} ${CLUSTER_NAME} RET=$? f_exit_or_not ${RET} @@ -363,7 +369,7 @@ run_xattr_test() LogRunMsg "xattr-test" ${BINDIR}/xattr-multi-run.sh -r 4 -f ${NODE_LIST} -a ssh -o ${logdir} \ --d ${DEVICE} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} ${MOUNT_POINT} >> ${LOGFILE} 2>&1 +-d ${DEVICE} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >> ${LOGFILE} 2>&1 LogRC $? } @@ -373,7 +379,7 @@ run_inline_test() LogRunMsg "inline-test" ${BINDIR}/multi-inline-run.sh -r 2 -f ${NODE_LIST} -a ssh -o ${logdir} \ --d ${DEVICE} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} ${MOUNT_POINT} >> ${LOGFILE} 2>&1 +-d ${DEVICE} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >> ${LOGFILE} 2>&1 LogRC $? } @@ -384,14 +390,14 @@ run_reflink_test() LogRunMsg "reflink-test" LogMsg "reflink 'data=ordered' mode test" ${BINDIR}/multi_reflink_test_run.sh -r 4 -f ${NODE_LIST} -a ssh -o \ -${logdir} -d ${DEVICE} ${MOUNT_POINT} >> ${LOGFILE} 2>&1 || { +${logdir} -d ${DEVICE} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >> ${LOGFILE} 2>&1 || { RET=$? LogRC $RET return $RET } # LogMsg "reflink 'data=writeback' mode test" # ${BINDIR}/multi_reflink_test_run.sh -r 4 -f ${NODE_LIST} -a ssh -o \ -#${logdir} -W -d ${DEVICE} ${MOUNT_POINT} >> ${LOGFILE} 2>&1 +#${logdir} -W -d ${DEVICE} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >> ${LOGFILE} 2>&1 LogRC $? } @@ -415,7 +421,7 @@ run_lvb_torture_test() LogMsg "Mkfs device ${DEVICE}:" f_mkfs ${LOGFILE} ${BLOCKSIZE} ${CLUSTERSIZE} ${LABELNAME} ${SLOTS} \ -${DEVICE} ${FEATURES} ${JOURNALSIZE} ${BLOCKS} +${DEVICE} ${FEATURES} ${JOURNALSIZE} ${BLOCKS} ${CLUSTER_STACK} ${CLUSTER_NAME} RET=$? f_exit_or_not ${RET} diff --git a/programs/python_common/o2tf.sh b/programs/python_common/o2tf.sh index a7e8b49..a6c7ba1 100755 --- a/programs/python_common/o2tf.sh +++ b/programs/python_common/o2tf.sh @@ -145,12 +145,18 @@ function f_mkfs() #${7} specify fs features #${8} specify journal size #${9} specify volume size + #${10} specify cluster stack + #${11} specify cluster name local slot_opts="" + local cluster_stack="" + local cluster_name="" if [ "${5}" == "0" ];then slot_opts="-M local" else slot_opts="-N ${5}" + cluster_stack="--cluster-stack=${10}" #cluster stack + cluster_name="--cluster-name=${11}" #cluster name fi local journal_opts="" @@ -170,12 +176,16 @@ function f_mkfs() local L=${4} #volume name local D=${6} #device name local O=${7} #fs featuers + local S=${10} #cluster stack + local N=${11} #cluster name - shift 9 + shift 11 R=${1} #Reserved options - f_LogMsg ${logfile} "${MKFS_BIN} --fs-features=${O} -b ${B} -C ${C} -L ${L} ${slot_opts} ${journal_opts} ${R} ${D} ${blocks}" - echo "y"|${MKFS_BIN} --fs-features=${O} -b ${B} -C ${C} -L ${L} ${slot_opts} ${journal_opts} ${R} ${D} ${blocks}>>${logfile} 2>&1 + f_LogMsg ${logfile} "${MKFS_BIN} --fs-features=${O} ${cluster_stack} ${cluster_name} \ +-b ${B} -C ${C} -L ${L} ${slot_opts} ${journal_opts} ${R} ${D} ${blocks}" + echo "y"|${MKFS_BIN} --fs-features=${O} ${cluster_stack} ${cluster_name} \ +-b ${B} -C ${C} -L ${L} ${slot_opts} ${journal_opts} ${R} ${D} ${blocks}>>${logfile} 2>&1 RET=$? if [ "${RET}" != "0" ];then diff --git a/programs/python_common/single_run-WIP.sh b/programs/python_common/single_run-WIP.sh index c7bbfdf..5c174f0 100755 --- a/programs/python_common/single_run-WIP.sh +++ b/programs/python_common/single_run-WIP.sh @@ -886,7 +886,7 @@ run_reserve_space() run_inline_data() { log_message "run_inline_data" $@ - if [ "$#" -lt "5" ]; then + if [ "$#" -lt "7" ]; then echo "Error in run_inline_data()" exit 1 fi @@ -896,9 +896,11 @@ run_inline_data() mountpoint=$3 blocksize=$4 clustersize=$5 + cluster_stack=$6 + cluster_name=$7 log_start "inline_data_test" - single-inline-run.sh -o ${logdir} -d ${device} -b ${blocksize} -c ${clustersize} ${mountpoint} + single-inline-run.sh -o ${logdir} -d ${device} -b ${blocksize} -c ${clustersize} -s ${cluster_stack} -n ${cluster_name} ${mountpoint} RC=$? log_end ${RC} } @@ -927,7 +929,7 @@ run_dx_dir() run_xattr_test() { log_message "run_xattr_test" $@ - if [ "$#" -lt "5" ]; then + if [ "$#" -lt "7" ]; then echo "Error in run_xattr_test()" exit 1 fi @@ -937,9 +939,11 @@ run_xattr_test() mountpoint=$3 blocksize=$4 clustersize=$5 + cluster_stack=$6 + cluster_name=$7 log_start "xattr_test" - xattr-single-run.sh -c -o ${logdir} -d ${device} -b ${blocksize} -C ${clustersize} ${mountpoint} + xattr-single-run.sh -c -o ${logdir} -d ${device} -b ${blocksize} -C ${clustersize} -s ${cluster_stack} -n ${cluster_name} ${mountpoint} RC=$? log_end ${RC} @@ -948,7 +952,7 @@ run_xattr_test() run_reflink_test() { log_message "run_reflink_test" $@ - if [ "$#" -lt "5" ]; then + if [ "$#" -lt "7" ]; then echo "Error in run_reflink()" exit 1 fi @@ -958,17 +962,19 @@ run_reflink_test() mountpoint=$3 blocksize=$4 clustersize=$5 + cluster_stack=$6 + cluster_name=$7 #ordered mount option log_start "reflink_test" "ordered" - reflink_test_run.sh -o ${logdir} -d ${device} -b ${blocksize} -c ${clustersize} ${mountpoint} || { + reflink_test_run.sh -o ${logdir} -d ${device} -b ${blocksize} -c ${clustersize} -s ${cluster_stack} -n ${cluster_name} ${mountpoint} || { RC=$? log_end ${RC} } #writeback mount option #log_start "reflink_test" "writeback" - #reflink_test_run.sh -W -o ${logdir} -d ${device} -b ${blocksize} -c ${clustersize} ${mountpoint} + #reflink_test_run.sh -W -o ${logdir} -d ${device} -b ${blocksize} -c ${clustersize} -s ${cluster_stack} -n ${cluster_name} ${mountpoint} RC=$? log_end ${RC} } @@ -997,7 +1003,7 @@ run_filecheck_test() run_mkfs() { log_message "run_mkfs" $@ - if [ "$#" -lt "5" ]; then + if [ "$#" -lt "7" ]; then echo "Error in run_mkfs()" exit 1 fi @@ -1007,9 +1013,11 @@ run_mkfs() mountpoint=$3 blocksize=$4 clustersize=$5 + cluster_stack=$6 + cluster_name=$7 log_start "mkfs_test" - mkfs-test.sh -o ${logdir} -d ${device} -m ${mountpoint} -b ${blocksize} -c ${clustersize} + mkfs-test.sh -o ${logdir} -d ${device} -m ${mountpoint} -b ${blocksize} -c ${clustersize} -s ${cluster_stack} -n ${cluster_name} RC=$? log_end ${RC} } @@ -1017,7 +1025,7 @@ run_mkfs() run_tunefs() { log_message "run_tunefs" $@ - if [ "$#" -lt "5" ]; then + if [ "$#" -lt "7" ]; then echo "Error in run_tunefs()" exit 1 fi @@ -1027,9 +1035,11 @@ run_tunefs() mountpoint=$3 blocksize=$4 clustersize=$5 + cluster_stack=$6 + cluster_name=$7 log_start "tunefs_test" - tunefs-test.sh -o ${logdir} -d ${device} -m ${mountpoint} -b ${blocksize} -c ${clustersize} + tunefs-test.sh -o ${logdir} -d ${device} -m ${mountpoint} -b ${blocksize} -c ${clustersize} -s ${cluster_stack} -n ${cluster_name} RC=$? log_end ${RC} } @@ -1037,7 +1047,7 @@ run_tunefs() run_backup_super() { log_message "run_backup_super" $@ - if [ "$#" -lt "4" ]; then + if [ "$#" -lt "6" ]; then echo "Error in run_backup_super()" exit 1 fi @@ -1046,9 +1056,11 @@ run_backup_super() device=$2 blocksize=$3 clustersize=$4 + cluster_stack=$5 + cluster_name=$6 log_start "backup_super_test" - test_backup_super.sh --log-dir=${logdir} --block-size=${blocksize} --cluster-size=${clustersize} ${device} + test_backup_super.sh --log-dir=${logdir} --block-size=${blocksize} --cluster-size=${clustersize} --cluster-stack=${cluster_stack} --cluster-name=${cluster_name} ${device} RC=$? log_end ${RC} } @@ -1061,11 +1073,13 @@ run_backup_super() usage() { - ${ECHO} "usage: ${APP} [-k kerneltarball] -m mountpoint -l logdir -d device [-t testcases] [-b blocksize] [-c clustersize]" + ${ECHO} "usage: ${APP} [-k kerneltarball] -m mountpoint -l logdir -d device [-t testcases] [-b blocksize] \ +[-c clustersize] [-s cluster-stack] [-n cluster-name]" exit 1 } -while getopts "d:m:k:l:t:b:c:h:?" args + +while getopts "d:m:k:l:t:b:c:s:n:h?" args do case "$args" in d) DEVICE="$OPTARG";; @@ -1075,11 +1089,12 @@ do t) TESTCASES="$OPTARG";; b) BLOCKSIZE="$OPTARG";; c) CLUSTERSIZE="$OPTARG";; - h) usage;; + s) CLUSTER_STACK="$OPTARG";; + n) CLUSTER_NAME="$OPTARG";; + h) usage;; ?) usage;; esac done - if [ -z ${DEVICE} ] ; then ${ECHO} "ERROR: No device" usage @@ -1096,6 +1111,16 @@ elif [ ! -d ${MOUNTPOINT} ] ; then exit 1 fi +if [ -z ${CLUSTER_STACK} ] ; then + ${ECHO} "ERROR: No cluster stack" + usage +fi + +if [ -z ${CLUSTER_NAME} ] ; then + ${ECHO} "ERROR: No cluster name" + usage +fi + if [ -z ${OUTDIR} ]; then ${ECHO} "ERROR: No logdir" usage @@ -1134,7 +1159,7 @@ ${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} ${BLOCKSIZE} ${CLUSTERSIZE} + run_create_and_open ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE} ${CLUSTER_STACK} ${CLUSTER_NAME} fi if [ "$tc"X = "directaio"X -o "$tc"X = "all"X ];then @@ -1184,7 +1209,7 @@ for tc in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do fi if [ "$tc"X = "mmap"X -o "$tc"X = "all"X ];then - run_mmap ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE} + run_mmap ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE} ${CLUSTER_STACK} ${CLUSTER_NAME} fi if [ "$tc"X = "reserve_space"X -o "$tc"X = "all"X ];then @@ -1192,15 +1217,15 @@ for tc in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do fi if [ "$tc"X = "inline"X -o "$tc"X = "all"X ];then - run_inline_data ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE} + run_inline_data ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE} ${CLUSTER_STACK} ${CLUSTER_NAME} fi if [ "$tc"X = "xattr"X -o "$tc"X = "all"X ];then - run_xattr_test ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE} + run_xattr_test ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE} ${CLUSTER_STACK} ${CLUSTER_NAME} fi if [ "$tc"X = "reflink"X -o "$tc"X = "all"X ];then - run_reflink_test ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE} + run_reflink_test ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE} ${CLUSTER_STACK} ${CLUSTER_NAME} fi if [ "$tc"X = "filecheck"X ];then @@ -1210,15 +1235,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} ${BLOCKSIZE} ${CLUSTERSIZE} + run_mkfs ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE} ${CLUSTER_STACK} ${CLUSTER_NAME} fi if [ "$tc"X = "tunefs"X -o "$tc"X = "all"X ];then - run_tunefs ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE} + run_tunefs ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${BLOCKSIZE} ${CLUSTERSIZE} ${CLUSTER_STACK} ${CLUSTER_NAME} fi if [ "$tc"X = "backup_super"X -o "$tc"X = "all"X ];then - run_backup_super ${LOGDIR} ${DEVICE} ${BLOCKSIZE} ${CLUSTERSIZE} + run_backup_super ${LOGDIR} ${DEVICE} ${BLOCKSIZE} ${CLUSTERSIZE} ${CLUSTER_STACK} ${CLUSTER_NAME} fi done diff --git a/programs/reflink_tests/multi_reflink_test_run.sh b/programs/reflink_tests/multi_reflink_test_run.sh index 3dc0c68..22923a0 100755 --- a/programs/reflink_tests/multi_reflink_test_run.sh +++ b/programs/reflink_tests/multi_reflink_test_run.sh @@ -70,6 +70,8 @@ LOG_FILE MOUNT_OPTS AIO_OPT+CLUSTER_STACK+CLUSTER_NAME DEFAULT_RANKS=4 MPI_RANKS@@ -90,7 +92,7 @@ set -o pipefail function f_usage() { echo "usage: `basename ${0}` [-r MPI_Ranks] <-f MPI_Hosts> \ -[-a access method] [-o logdir] <-d <device>> <-b block size> <-c cluster size> [-W] [-A] <mountpoint path>" +[-a access method] [-o logdir] <-d <device>> <-b block size> <-c cluster size> <-s <cluster stack>> <-n <cluster name>> [-W] [-A] <mountpoint path>" echo " -r size of MPI rank" echo " -a access method for mpi execution,should be ssh or rsh" echo " -f MPI hosts list,separated by comma" @@ -101,6 +103,8 @@ function f_usage() echo " -i Network Interface name to be used for MPI messaging." echo " -W enable data=writeback mode" echo " -A enable asynchronous io testing mode" + echo " -s cluster stack" + echo " -n cluster name" echo " <mountpoint path> specify the mounting point." exit 1; @@ -112,7 +116,7 @@ function f_getoptions() exit 1 fi - while getopts "o:d:i:r:f:WAha:b:c:" options; do + while getopts "o:d:i:r:f:WAha:b:c:s:n:" options; do case $options in r ) MPI_RANKS="$OPTARG";; f ) MPI_HOSTS="$OPTARG";; @@ -124,6 +128,8 @@ function f_getoptions() c ) CLUSTERSIZE="$OPTARG";; W ) MOUNT_OPTS="data=writeback";; A ) AIO_OPT=" -A ";; + s ) CLUSTER_STACK="$OPTARG";; + n ) CLUSTER_NAME="$OPTARG";; h ) f_usage exit 1;; * ) f_usage @@ -195,7 +201,7 @@ function f_runtest() { f_LogRunMsg ${RUN_LOG_FILE} "[*] Mkfs device ${DEVICE}:" f_mkfs ${LOG_FILE} ${BLOCKSIZE} ${CLUSTERSIZE} ${LABELNAME} ${SLOTS} \ -${DEVICE} "refcount,xattr" ${JOURNALSIZE} ${BLOCKS} +${DEVICE} "refcount,xattr" ${JOURNALSIZE} ${BLOCKS} ${CLUSTER_STACK} ${CLUSTER_NAME} RET=$? f_echo_status ${RET}| tee -a ${RUN_LOG_FILE} f_exit_or_not ${RET} diff --git a/programs/reflink_tests/reflink_test_run.sh b/programs/reflink_tests/reflink_test_run.sh index d09a8f0..f415185 100755 --- a/programs/reflink_tests/reflink_test_run.sh +++ b/programs/reflink_tests/reflink_test_run.sh @@ -101,6 +101,8 @@ function f_usage() [-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 " -s cluster stack" + echo " -n cluster name" echo " -W enable data=writeback mode" echo " -A enable asynchronous io testing mode" echo " -D enable destructive test,it will crash the testing node,\ @@ -119,7 +121,7 @@ function f_getoptions() exit 1 fi - while getopts "o:WDAhd:a:p:v:b:c:" options; do + while getopts "o:WDAhd:a:p:v:b:c:s:n:" options; do case $options in o ) LOG_DIR="$OPTARG";; d ) DEVICE="$OPTARG";; @@ -131,6 +133,8 @@ function f_getoptions() v ) VERI_LOG="$OPTARG";; b ) BLOCKSIZE="$OPTARG";; c ) CLUSTERSIZE="$OPTARG";; + s ) CLUSTER_STACK="$OPTARG";; + n ) CLUSTER_NAME="$OPTARG";; h ) f_usage;; * ) f_usage;; esac @@ -422,7 +426,7 @@ ${WORK_PLACE} -v ${VERI_LOG} >>${LOG_FILE} 2>&1 f_LogRunMsg ${RUN_LOG_FILE} "[*] Mkfs device ${DEVICE}:" f_mkfs ${LOG_FILE} ${BLOCKSIZE} ${CLUSTERSIZE} ${LABELNAME} ${SLOTS} \ -${DEVICE} "refcount,xattr" ${JOURNALSIZE} ${BLOCKS} +${DEVICE} "refcount,xattr" ${JOURNALSIZE} ${BLOCKS} ${CLUSTER_STACK} ${CLUSTER_NAME} RET=$? f_echo_status ${RET}| tee -a ${RUN_LOG_FILE} f_exit_or_not ${RET} diff --git a/programs/tunefs-test/tunefs-test.sh b/programs/tunefs-test/tunefs-test.sh index 0fc3da3..ea5439d 100755 --- a/programs/tunefs-test/tunefs-test.sh +++ b/programs/tunefs-test/tunefs-test.sh @@ -167,8 +167,8 @@ function test_summary() Set_Volume_For_Test() { LogMsg "tunefs_test : Initializing volume for test" - echo "y"| ${MKFS_BIN} ${FS_FEATURES} -b ${BLOCKSIZE} -C ${CLUSTERSIZE} -L ${LABEL1} -N ${NNODES1} \ - -J size=${JOURNAL1} ${2} ${DEVICE} ${1} 2>&1 >> ${MKFSLOG} + echo "y"| ${MKFS_BIN} ${FS_FEATURES} --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} \ +-b ${BLOCKSIZE} -C ${CLUSTERSIZE} -L ${LABEL1} -N ${NNODES1} -J size=${JOURNAL1} ${2} ${DEVICE} ${1} 2>&1 >> ${MKFSLOG} Check_Volume; } # @@ -237,7 +237,8 @@ Test_Query() (( ++NUM_OF_TESTS )) # Set_Volume_For_Test ${BLKCNT1} --fs-feature-level=default echo "y"| ${MKFS_BIN} -b ${BLOCKSIZE} -C ${CLUSTERSIZE} -L ${LABEL1} -N ${NNODES1} \ - -J size=${JOURNAL1} --fs-feature-level=default ${DEVICE} ${BLKCNT1} 2>&1 >> ${MKFSLOG} +-J size=${JOURNAL1} --fs-feature-level=default --cluster-stack=${CLUSTER_STACK} \ +--cluster-name=${CLUSTER_NAME} ${DEVICE} ${BLKCNT1} 2>&1 >> ${MKFSLOG} CURRENT_TEST="Test Query"; QRY1="Blks=%B\nClus=%T\nSlot=%N\nRoot=%R\nSysd=%Y\nFclg=%P\n"; QRY2="Labl=%V\nUuid=%U\n"; @@ -661,7 +662,7 @@ TUNEFS_TEST=`basename $0` bindir=`basename ${0}` LOG_DIR=`basename ${bindir}` -while getopts "d:o:m:b:c:" args +while getopts "d:o:m:b:c:s:n:" args do case "$args" in o) LOG_DIR="$OPTARG";; @@ -669,6 +670,8 @@ do m) MOUNT_POINT="$OPTARG";; b) BLOCKSIZE="$OPTARG";; c) CLUSTERSIZE="$OPTARG";; + s) CLUSTER_STACK="$OPTARG";; + n) CLUSTER_NAME="$OPTARG";; esac done diff --git a/programs/xattr_tests/xattr-multi-run.sh b/programs/xattr_tests/xattr-multi-run.sh index 0a4f464..2c13929 100755 --- a/programs/xattr_tests/xattr-multi-run.sh +++ b/programs/xattr_tests/xattr-multi-run.sh @@ -69,6 +69,8 @@ LOG_OUT_DIR LOG_FILE RUN_LOG_FILE MOUNT_POINT+CLUSTER_STACK+CLUSTER_NAME OCFS2_DEVICE SLOTS@@ -145,7 +147,7 @@ exit_or_not() ################################################################################ f_usage() { - echo "usage: `basename ${0}` [-r MPI_Ranks] <-f MPI_Hosts> [-a access method] [-o output] [-i interface] <-d <device>> <-b blocksize> <-c clustersize> <mountpoint path>" + echo "usage: `basename ${0}` [-r MPI_Ranks] <-f MPI_Hosts> [-a access method] [-o output] [-i interface] <-d <device>> <-b blocksize> <-c clustersize> <-s cluster-stack> <-n cluster-name> <mountpoint path>" echo " -r size of MPI rank" echo " -a access method for process propagation,should be ssh or rsh,set ssh as a default method when omited." echo " -f MPI hosts list,separated by comma,e.g -f node1.us.oracle.com,node2.us.oracle.com." @@ -154,10 +156,13 @@ f_usage() echo " -d specify the device which has been formated as an ocfs2 volume." echo " -b block size." echo " -c cluster size." + echo " -s cluster stack." + echo " -n cluster name." echo " <mountpoint path> path of mountpoint where the ocfs2 volume will be mounted on." exit 1; } + f_getoptions() { if [ $# -eq 0 ]; then @@ -165,7 +170,7 @@ f_getoptions() exit 1 fi - while getopts "o:d:r:f:a:h:i:b:c:" options; do + while getopts "o:d:r:f:a:h:i:b:c:s:n:" options; do case $options in r ) MPI_RANKS="$OPTARG";; f ) MPI_HOSTS="$OPTARG";; @@ -175,12 +180,16 @@ f_getoptions() i ) INTERFACE="$OPTARG";; b ) BLOCKSIZE="$OPTARG";; c ) CLUSTERSIZE="$OPTARG";; + s ) CLUSTER_STACK="$OPTARG";; + n ) CLUSTER_NAME="$OPTARG";; + h ) f_usage exit 1;; * ) f_usage exit 1;; esac done + shift $(($OPTIND -1)) MOUNT_POINT=${1} } @@ -256,7 +265,7 @@ f_do_mkfs_and_mount() { echo -n "Mkfsing device(-b ${BLOCKSIZE} -C ${CLUSTERSIZE}): "|tee -a ${RUN_LOG_FILE} - echo y|${MKFS_BIN} --fs-features=xattr -b ${BLOCKSIZE} -C ${CLUSTERSIZE} -N ${SLOTS} -L ${LABEL} ${OCFS2_DEVICE} ${BLOCKNUMS}>>${RUN_LOG_FILE} 2>&1 + echo y|${MKFS_BIN} --fs-features=xattr -b ${BLOCKSIZE} -C ${CLUSTERSIZE} --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} -N ${SLOTS} -L ${LABEL} ${OCFS2_DEVICE} ${BLOCKNUMS}>>${RUN_LOG_FILE} 2>&1 RET=$? echo_status ${RET} |tee -a ${RUN_LOG_FILE} diff --git a/programs/xattr_tests/xattr-single-run.sh b/programs/xattr_tests/xattr-single-run.sh index 1d3e8f7..93d85ac 100755 --- a/programs/xattr_tests/xattr-single-run.sh +++ b/programs/xattr_tests/xattr-single-run.sh @@ -144,12 +144,15 @@ exit_or_not() ################################################################################ f_usage() { - echo "usage: `basename ${0}` [-c] [-o output_log_dir] <-d <device>> <-b <block size>> <-C <cluster size>> <mountpoint path>" + echo "usage: `basename ${0}` [-c] [-o output_log_dir] <-d <device>> <-b <block size>> \ +<-s <stack name>> <-c <cluster name>> <-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 " -s cluster stack." + echo " -n cluster name." echo " <mountpoint path> path of mountpoint where the ocfs2 volume will be mounted on." exit 1; @@ -162,13 +165,15 @@ f_getoptions() exit 1 fi - while getopts "cho:d:b:C:" options; do + while getopts "cho:d:b:C:s:n:" options; do case $options in c ) COMBIN_TEST="1";; o ) LOG_OUT_DIR="$OPTARG";; d ) OCFS2_DEVICE="$OPTARG";; b ) BLOCKSIZE="$OPTARG";; C ) CLUSTERSIZE="$OPTARG";; + s ) CLUSTER_STACK="$OPTARG";; + n ) CLUSTER_NAME="$OPTARG";; h ) f_usage exit 1;; * ) f_usage @@ -226,9 +231,9 @@ f_do_mkfs_and_mount() echo -n "Mkfsing device:"|tee -a ${RUN_LOG_FILE} if [ -z "${COMBIN_TEST}" ];then - echo y|${MKFS_BIN} --fs-features=xattr -b ${BLOCKSIZE} -C ${CLUSTERSIZE} -N 1 ${OCFS2_DEVICE} ${BLOCKNUMS}>>${RUN_LOG_FILE} 2>&1 + echo y|${MKFS_BIN} --fs-features=xattr --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} -b ${BLOCKSIZE} -C ${CLUSTERSIZE} -N 1 ${OCFS2_DEVICE} ${BLOCKNUMS}>>${RUN_LOG_FILE} 2>&1 else - echo y|${MKFS_BIN} --fs-features=xattr,inline-data -b ${BLOCKSIZE} -C ${CLUSTERSIZE} -N 1 ${OCFS2_DEVICE} ${BLOCKNUMS}>>${RUN_LOG_FILE} 2>&1 + echo y|${MKFS_BIN} --fs-features=xattr,inline-data --cluster-stack=${CLUSTER_STACK} --cluster-name=${CLUSTER_NAME} -b ${BLOCKSIZE} -C ${CLUSTERSIZE} -N 1 ${OCFS2_DEVICE} ${BLOCKNUMS}>>${RUN_LOG_FILE} 2>&1 fi RET=$? echo_status ${RET} |tee -a ${RUN_LOG_FILE} -- 2.6.6
Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 13/17] Save punch_hole details into logfile for debugging convenience
Signed-off-by: Eric Ren <zren at suse.com> --- programs/discontig_bg_test/discontig_runner.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/programs/discontig_bg_test/discontig_runner.sh b/programs/discontig_bg_test/discontig_runner.sh index 3be39c8..4c13adb 100755 --- a/programs/discontig_bg_test/discontig_runner.sh +++ b/programs/discontig_bg_test/discontig_runner.sh @@ -41,6 +41,7 @@ DEFAULT_LOG_DIR=${O2TDIR}/log LOG_DIR RUN_LOG_FILE LOG_FILE+PUNCH_LOG_FILE BLOCKSIZE CLUSTERSIZE@@ -162,6 +163,8 @@ function f_setup() %M-%S`-discontig-bg-run.log" LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date +%F-%H-\ %M-%S`-discontig-bg.log" + PUNCH_LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date +%F-%H-\ +%M-%S`-punch-hole.log" } @@ -529,7 +532,7 @@ function f_extents_test() recs_in_blk=$(((${BLOCKSIZE}-64)/16)) while :;do if [ "$((${RANDOM}%2))" -eq "0" ];then - ${PUNCH_HOLE_BIN} -f ${filename} -s ${offset} -l $((${CLUSTERSIZE}*${recs_in_blk})) >>/dev/null 2>&1 || { + ${PUNCH_HOLE_BIN} -f ${filename} -s ${offset} -l $((${CLUSTERSIZE}*${recs_in_blk})) >>${PUNCH_LOG_FILE} 2>&1 || { f_LogMsg ${LOG_FILE} "Punch hole at offset:${offset} failed." return 1 } @@ -798,13 +801,13 @@ function f_refcount_test() fi while :;do if [ "$((${RANDOM}%2))" -eq "0" ];then - ${PUNCH_HOLE_BIN} -f ${orig_filename} -s ${offset} -l ${CLUSTERSIZE} >>/dev/null 2>&1 || { + ${PUNCH_HOLE_BIN} -f ${orig_filename} -s ${offset} -l ${CLUSTERSIZE} >>${PUNCH_LOG_FILE} 2>&1 || { f_LogMsg ${LOG_FILE} "Punch hole at offset:${offset} failed on ${orig_filename}." return 1 } fi if [ "$((${RANDOM}%2))" -eq "1" ];then - ${PUNCH_HOLE_BIN} -f ${ref_filename} -s ${offset} -l ${CLUSTERSIZE} >>/dev/null 2>&1 || { + ${PUNCH_HOLE_BIN} -f ${ref_filename} -s ${offset} -l ${CLUSTERSIZE} >>${PUNCH_LOG_FILE} 2>&1 || { f_LogMsg ${LOG_FILE} "Punch hole at offset:${offset} failed on ${ref_filename}." return 1 } @@ -822,14 +825,14 @@ function f_refcount_test() recs_in_blk=$(((${BLOCKSIZE}-64)/16)) while :;do if [ "$((${RANDOM}%2))" -eq "0" ];then - ${PUNCH_HOLE_BIN} -f ${orig_filename} -s ${offset} -l $((${CLUSTERSIZE}*${recs_in_blk})) >>/dev/null 2>&1 || { + ${PUNCH_HOLE_BIN} -f ${orig_filename} -s ${offset} -l $((${CLUSTERSIZE}*${recs_in_blk})) >>${PUNCH_LOG_FILE} 2>&1 || { f_LogMsg ${LOG_FILE} "Punch hole at offset:${offset} failed on ${orig_filename}." return 1 } fi if [ "$((${RANDOM}%2))" -eq "1" ];then - ${PUNCH_HOLE_BIN} -f ${ref_filename} -s ${offset} -l $((${CLUSTERSIZE}*${recs_in_blk})) >>/dev/null 2>&1 || { + ${PUNCH_HOLE_BIN} -f ${ref_filename} -s ${offset} -l $((${CLUSTERSIZE}*${recs_in_blk})) >>${PUNCH_LOG_FILE} 2>&1 || { f_LogMsg ${LOG_FILE} "Punch hole at offset:${offset} failed on ${ref_filename}." return 1 } -- 2.6.6
Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 14/17] Fix openmpi warning by specifying proper slot number
The warning message as below: " There are not enough slots available in the system to satisfy the 4 slots that were requested by the application: ./xattr-multi-test Either request fewer slots for your application, or make more slots available for use. " outputs when specifying a rank number for openmpi more than "mkfs" slots. Signed-off-by: Eric Ren <zren at suse.com> --- programs/python_common/multiple_run.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/programs/python_common/multiple_run.sh b/programs/python_common/multiple_run.sh index 3e52eff..74c3531 100755 --- a/programs/python_common/multiple_run.sh +++ b/programs/python_common/multiple_run.sh @@ -368,7 +368,7 @@ run_xattr_test() local logdir=${LOG_DIR}/multi-xattr-test LogRunMsg "xattr-test" - ${BINDIR}/xattr-multi-run.sh -r 4 -f ${NODE_LIST} -a ssh -o ${logdir} \ + ${BINDIR}/xattr-multi-run.sh -r ${SLOTS} -f ${NODE_LIST} -a ssh -o ${logdir} \ -d ${DEVICE} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >> ${LOGFILE} 2>&1 LogRC $? } @@ -378,7 +378,7 @@ run_inline_test() local logdir=${LOG_DIR}/multi-inline-test LogRunMsg "inline-test" - ${BINDIR}/multi-inline-run.sh -r 2 -f ${NODE_LIST} -a ssh -o ${logdir} \ + ${BINDIR}/multi-inline-run.sh -r ${SLOTS} -f ${NODE_LIST} -a ssh -o ${logdir} \ -d ${DEVICE} -b ${BLOCKSIZE} -c ${CLUSTERSIZE} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >> ${LOGFILE} 2>&1 LogRC $? } @@ -389,7 +389,7 @@ run_reflink_test() LogRunMsg "reflink-test" LogMsg "reflink 'data=ordered' mode test" - ${BINDIR}/multi_reflink_test_run.sh -r 4 -f ${NODE_LIST} -a ssh -o \ + ${BINDIR}/multi_reflink_test_run.sh -r ${SLOTS} -f ${NODE_LIST} -a ssh -o \ ${logdir} -d ${DEVICE} -s ${CLUSTER_STACK} -n ${CLUSTER_NAME} ${MOUNT_POINT} >> ${LOGFILE} 2>&1 || { RET=$? LogRC $RET -- 2.6.6
Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 15/17] Handle the case when a symbolic link device is given
It's a usual case that the shared disk is given in symbolic name, like iscsi disk "/dev/disk/by-path/disk". So work out the typical device name in such case. Signed-off-by: Eric Ren <zren at suse.com> --- programs/discontig_bg_test/discontig_runner.sh | 5 +++++ programs/python_common/multiple_run.sh | 13 +++++++++++++ programs/python_common/single_run-WIP.sh | 6 ++++++ 3 files changed, 24 insertions(+) diff --git a/programs/discontig_bg_test/discontig_runner.sh b/programs/discontig_bg_test/discontig_runner.sh index 4c13adb..182ca3a 100755 --- a/programs/discontig_bg_test/discontig_runner.sh +++ b/programs/discontig_bg_test/discontig_runner.sh @@ -126,6 +126,11 @@ function f_setup() if [ -z "${DEVICE}" ];then f_usage fi + + # if a symbollink is given, work out the typical device name, like /dev/sda + if [ -L ${DEVICE} ];then + DEVICE=`readlink -f ${DEVICE}` + fi if [ -z "${MOUNT_POINT}" ];then f_usage diff --git a/programs/python_common/multiple_run.sh b/programs/python_common/multiple_run.sh index 74c3531..3e11abd 100755 --- a/programs/python_common/multiple_run.sh +++ b/programs/python_common/multiple_run.sh @@ -135,6 +135,19 @@ f_setup() f_getoptions $* + if [ -z ${DEVICE} ] ; then + ${ECHO} "ERROR: No device" + f_usage + elif [ ! -b ${DEVICE} ] ; then + ${ECHO} "ERROR: Invalid device ${DEVICE}" + exit 1 + fi + + # if a symbollink is given, work out the typical device name, like /dev/sda + if [ -L ${DEVICE} ];then + DEVICE=`readlink -f ${DEVICE}` + fi + if [ -z "${MOUNT_POINT}" ];then f_usage fi diff --git a/programs/python_common/single_run-WIP.sh b/programs/python_common/single_run-WIP.sh index 5c174f0..92d1216 100755 --- a/programs/python_common/single_run-WIP.sh +++ b/programs/python_common/single_run-WIP.sh @@ -1095,6 +1095,7 @@ do ?) usage;; esac done + if [ -z ${DEVICE} ] ; then ${ECHO} "ERROR: No device" usage @@ -1103,6 +1104,11 @@ elif [ ! -b ${DEVICE} ] ; then exit 1 fi +# if a symbollink is given, work out the typical device name, like /dev/sda +if [ -L ${DEVICE} ];then + DEVICE=`readlink -f ${DEVICE}` +fi + if [ -z ${MOUNTPOINT} ] ; then ${ECHO} "ERROR: No mountpoint" usage -- 2.6.6
Signed-off-by: Eric Ren <zren at suse.com> --- programs/defrag-test/frager.c | 2 +- programs/directio_test/directio_test.c | 2 +- programs/discontig_bg_test/spawn_inodes.c | 2 +- programs/dx_dirs_tests/index_dir.c | 2 +- programs/inline-data/inline-data.c | 2 +- programs/inline-data/inline-dirs.c | 2 +- programs/reflink_tests/reflink_test.c | 2 +- programs/xattr_tests/xattr-test.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/programs/defrag-test/frager.c b/programs/defrag-test/frager.c index f510dde..473c31c 100755 --- a/programs/defrag-test/frager.c +++ b/programs/defrag-test/frager.c @@ -86,7 +86,7 @@ static int usage(void) static void sigchld_handler() { pid_t pid; - union wait status; + int status; while (1) { pid = wait3(&status, WNOHANG, NULL); diff --git a/programs/directio_test/directio_test.c b/programs/directio_test/directio_test.c index 7ec5278..21bc32c 100755 --- a/programs/directio_test/directio_test.c +++ b/programs/directio_test/directio_test.c @@ -214,7 +214,7 @@ static int teardown(void) static void sigchld_handler() { pid_t pid; - union wait status; + int status; while (1) { pid = wait3(&status, WNOHANG, NULL); diff --git a/programs/discontig_bg_test/spawn_inodes.c b/programs/discontig_bg_test/spawn_inodes.c index 6bb7a93..633f0a9 100755 --- a/programs/discontig_bg_test/spawn_inodes.c +++ b/programs/discontig_bg_test/spawn_inodes.c @@ -64,7 +64,7 @@ static int usage(void) static void sigchld_handler() { pid_t pid; - union wait status; + int status; while (1) { pid = wait3(&status, WNOHANG, NULL); diff --git a/programs/dx_dirs_tests/index_dir.c b/programs/dx_dirs_tests/index_dir.c index 75ea8bd..ffdfa0f 100755 --- a/programs/dx_dirs_tests/index_dir.c +++ b/programs/dx_dirs_tests/index_dir.c @@ -926,7 +926,7 @@ void random_test(void) static void sigchld_handler() { pid_t pid; - union wait status; + int status; while (1) { pid = wait3(&status, WNOHANG, NULL); diff --git a/programs/inline-data/inline-data.c b/programs/inline-data/inline-data.c index 13124d7..daaee3c 100644 --- a/programs/inline-data/inline-data.c +++ b/programs/inline-data/inline-data.c @@ -256,7 +256,7 @@ static int teardown(void) static void sigchld_handler() { pid_t pid; - union wait status; + int status; while (1) { pid = wait3(&status, WNOHANG, NULL); diff --git a/programs/inline-data/inline-dirs.c b/programs/inline-data/inline-dirs.c index ac7882f..0db24b9 100644 --- a/programs/inline-data/inline-dirs.c +++ b/programs/inline-data/inline-dirs.c @@ -357,7 +357,7 @@ static void run_large_dir_tests(void) static void sigchld_handler() { pid_t pid; - union wait status; + int status; while (1) { pid = wait3(&status, WNOHANG, NULL); diff --git a/programs/reflink_tests/reflink_test.c b/programs/reflink_tests/reflink_test.c index 22386db..2801968 100755 --- a/programs/reflink_tests/reflink_test.c +++ b/programs/reflink_tests/reflink_test.c @@ -965,7 +965,7 @@ static int stress_test() static void sigchld_handler() { pid_t pid; - union wait status; + int status; while (1) { pid = wait3(&status, WNOHANG, NULL); diff --git a/programs/xattr_tests/xattr-test.c b/programs/xattr_tests/xattr-test.c index d204aba..77be780 100755 --- a/programs/xattr_tests/xattr-test.c +++ b/programs/xattr_tests/xattr-test.c @@ -301,7 +301,7 @@ static void judge_sys_return(int ret, const char *sys_func) static void sigchld_handler() { pid_t pid; - union wait status; + int status; while (1) { pid = wait3(&status, WNOHANG, NULL); if (pid <= 0) -- 2.6.6
Eric Ren
2016-Dec-13 05:29 UTC
[Ocfs2-devel] [PATCH 17/17] discontig bg: give single and multiple node test different log file name
Signed-off-by: Eric Ren <zren at suse.com> --- programs/discontig_bg_test/discontig_runner.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/programs/discontig_bg_test/discontig_runner.sh b/programs/discontig_bg_test/discontig_runner.sh index 182ca3a..f3a69f5 100755 --- a/programs/discontig_bg_test/discontig_runner.sh +++ b/programs/discontig_bg_test/discontig_runner.sh @@ -164,8 +164,13 @@ function f_setup() LOG_DIR=${LOG_DIR:-$DEFAULT_LOG_DIR} ${MKDIR_BIN} -p ${LOG_DIR} || exit 1 - RUN_LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date +%F-%H-\ -%M-%S`-discontig-bg-run.log" + if [ -n "${MULTI_TEST}" ];then + RUN_LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date +%F-%H-\ +%M-%S`-discontig-bg-multiple-run.log" + else + RUN_LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date +%F-%H-\ +%M-%S`-discontig-bg-single-run.log" + fi LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date +%F-%H-\ %M-%S`-discontig-bg.log" PUNCH_LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date +%F-%H-\ -- 2.6.6
Eric Ren
2017-Jan-05 06:30 UTC
[Ocfs2-devel] [PATCH 00/17] ocfs2-test: misc improvements and trivial fixes
Hi all, I will push this patches into "suse" branch at Mark's github repo, considering no review accepted for more than 2 weeks. According to Mark's advice, patch can be merged only when it has a review;-) Thanks, Eric On 12/13/2016 01:29 PM, Eric Ren wrote:> - Misc trivial fixes: > > [PATCH 01/17] ocfs2 test: correct the check on testcase if supported > [PATCH 02/17] Single Run: kernel building is little broken now > [PATCH 03/17] Trivial: better not to depend on where we issue testing > [PATCH 04/17] Trivial: fix a typo mistake > [PATCH 05/17] Trivial: fix checking empty return value > [PATCH 06/17] multi_mmap: make log messages go to right place > [PATCH 07/17] lvb_torture: failed when pcmk is used as cluster stack > [PATCH 08/17] multiple node: pass cross_delete the right log file > > - This patches add two more parameters: blocksize and clustersize when we > kick off a testing, which shortens the run time of a testing round. > It will keep the old behaviors if they are not specified. > > [PATCH 09/17] Single run: make blocksize and clustersize as > [PATCH 10/17] Multiple run: make blocksize and clustersize as > [PATCH 11/17] discontig bg: make blocksize and clustersize as > > - This patch reflects the mkfs.ocfs2 changes that "--cluster-stack" and > "--cluster-name" were added. > > [PATCH 12/17] Add two cluster-aware parameters: cluster stack and cluster name > > - More misc trival fixes: > > [PATCH 13/17] Save punch_hole details into logfile for debugging > [PATCH 14/17] Fix openmpi warning by specifying proper slot number > [PATCH 15/17] Handle the case when a symbolic link device is given > [PATCH 16/17] inline data: fix build error > [PATCH 17/17] discontig bg: give single and multiple node test > > Comments and questions are, as always, welcome. > > Thanks, > Eric >
Junxiao Bi
2017-Mar-13 08:11 UTC
[Ocfs2-devel] [PATCH 01/17] ocfs2 test: correct the check on testcase if supported
On 12/13/2016 01:29 PM, Eric Ren wrote:> Signed-off-by: Eric Ren <zren at suse.com>Reviewed-by: Junxiao Bi <junxiao.bi at oracle.com>> --- > programs/python_common/multiple_run.sh | 2 +- > programs/python_common/single_run-WIP.sh | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/programs/python_common/multiple_run.sh b/programs/python_common/multiple_run.sh > index dd9603f..c4a7da9 100755 > --- a/programs/python_common/multiple_run.sh > +++ b/programs/python_common/multiple_run.sh > @@ -201,7 +201,7 @@ f_setup() > fi > > SUPPORTED_TESTCASES="all xattr inline reflink write_append_truncate multi_mmap create_racer flock_unit cross_delete open_delete lvb_torture" > - for cas in ${TESTCASES}; do > + for cas in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do > echo ${SUPPORTED_TESTCASES} | grep -sqw $cas > if [ $? -ne 0 ]; then > echo "testcase [${cas}] not supported." > diff --git a/programs/python_common/single_run-WIP.sh b/programs/python_common/single_run-WIP.sh > index 5a8fae1..fe0056c 100755 > --- a/programs/python_common/single_run-WIP.sh > +++ b/programs/python_common/single_run-WIP.sh > @@ -997,7 +997,7 @@ fi > 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" > -for cas in ${TESTCASES}; do > +for cas in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do > echo ${SUPPORTED_TESTCASES} | grep -sqw $cas > if [ $? -ne 0 ]; then > echo "testcase [${cas}] not supported." >
Junxiao Bi
2017-Mar-13 08:12 UTC
[Ocfs2-devel] [PATCH 02/17] Single Run: kernel building is little broken now
On 12/13/2016 01:29 PM, Eric Ren wrote:> Only check kernel source if we specify "buildkernel" test case. > The original kernel source web-link cannot be reached, > so give a new link instead but the md5sum check is missing > now. > > Signed-off-by: Eric Ren <zren at suse.com> > --- > programs/python_common/single_run-WIP.sh | 56 ++++++++++++++++---------------- > 1 file changed, 28 insertions(+), 28 deletions(-) > > diff --git a/programs/python_common/single_run-WIP.sh b/programs/python_common/single_run-WIP.sh > index fe0056c..61008d8 100755 > --- a/programs/python_common/single_run-WIP.sh > +++ b/programs/python_common/single_run-WIP.sh > @@ -20,9 +20,9 @@ WGET=`which wget` > WHOAMI=`which whoami` > SED=`which sed` > > -DWNLD_PATH="http://oss.oracle.com/~smushran/ocfs2-test" > -KERNEL_TARBALL="linux-kernel.tar.gz" > -KERNEL_TARBALL_CHECK="${KERNEL_TARBALL}.md5sum" > +DWNLD_PATH="https://cdn.kernel.org/pub/linux/kernel/v3.x/" > +KERNEL_TARBALL="linux-3.2.80.tar.xz" > +#KERNEL_TARBALL_CHECK="${KERNEL_TARBALL}.md5sum"Can we compute the md5sum manually and put it here? Thanks, Junxiao.> USERID=`${WHOAMI}` > > DEBUGFS_BIN="${SUDO} `which debugfs.ocfs2`" > @@ -85,7 +85,7 @@ get_bits() > # get_kernel_source $LOGDIR $DWNLD_PATH $KERNEL_TARBALL $KERNEL_TARBALL_CHECK > get_kernel_source() > { > - if [ "$#" -lt "4" ]; then > + if [ "$#" -lt "3" ]; then > ${ECHO} "Error in get_kernel_source()" > exit 1 > fi > @@ -93,18 +93,18 @@ get_kernel_source() > logdir=$1 > dwnld_path=$2 > kernel_tarball=$3 > - kernel_tarball_check=$4 > + #kernel_tarball_check=$4 > > cd ${logdir} > > outlog=get_kernel_source.log > > - ${WGET} -o ${outlog} ${dwnld_path}/${kernel_tarball_check} > - if [ $? -ne 0 ]; then > - ${ECHO} "ERROR downloading ${dwnld_path}/${kernel_tarball_check}" > - cd - > - exit 1 > - fi > +# ${WGET} -o ${outlog} ${dwnld_path}/${kernel_tarball_check} > +# if [ $? -ne 0 ]; then > +# ${ECHO} "ERROR downloading ${dwnld_path}/${kernel_tarball_check}" > +# cd - > +# exit 1 > +# fi > > ${WGET} -a ${outlog} ${dwnld_path}/${kernel_tarball} > if [ $? -ne 0 ]; then > @@ -113,13 +113,13 @@ get_kernel_source() > exit 1 > fi > > - ${MD5SUM} -c ${kernel_tarball_check} >>${outlog} 2>&1 > - if [ $? -ne 0 ]; then > - ${ECHO} "ERROR ${kernel_tarball_check} check failed" > - cd - > - exit 1 > - fi > - cd - > +# ${MD5SUM} -c ${kernel_tarball_check} >>${outlog} 2>&1 > +# if [ $? -ne 0 ]; then > +# ${ECHO} "ERROR ${kernel_tarball_check} check failed" > +# cd - > +# exit 1 > +# fi > +# cd - > } > > # do_format() ${BLOCKSIZE} ${CLUSTERSIZE} ${FEATURES} ${DEVICE} > @@ -1012,16 +1012,6 @@ LOGFILE=${LOGDIR}/single_run.log > > do_mkdir ${LOGDIR} > > -if [ -z ${KERNELSRC} ]; then > - get_kernel_source $LOGDIR $DWNLD_PATH $KERNEL_TARBALL $KERNEL_TARBALL_CHECK > - KERNELSRC=${LOGDIR}/${KERNEL_TARBALL} > -fi > - > -if [ ! -f ${KERNELSRC} ]; then > - ${ECHO} "No kernel source" > - usage > -fi > - > STARTRUN=$(date +%s) > log_message "*** Start Single Node test ***" > > @@ -1058,6 +1048,16 @@ for tc in `${ECHO} ${TESTCASES} | ${SED} "s:,: :g"`; do > fi > > if [ "$tc"X = "buildkernel"X -o "$tc"X = "all"X ];then > + if [ -z ${KERNELSRC} ]; then > + get_kernel_source $LOGDIR $DWNLD_PATH $KERNEL_TARBALL #$KERNEL_TARBALL_CHECK > + KERNELSRC=${LOGDIR}/${KERNEL_TARBALL} > + fi > + > + if [ ! -f ${KERNELSRC} ]; then > + ${ECHO} "No kernel source" > + usage > + fi > + > run_buildkernel ${LOGDIR} ${DEVICE} ${MOUNTPOINT} ${KERNELSRC} > fi > >