[Ocfs2-test-devel] [PATCH 8/9] Ocfs2-test: Add single-node testing launcher for reflink tests.
tristan.ye
tristan.ye at oracle.com
Sun Apr 5 18:51:39 PDT 2009
Marcos E. Matsunaga Wrote:
> I have only one comment on this. I believe the second line of code,
> BINDIR, is not supposed to be there.
>
> Everything else looks good to me.
Cool, marcos, it does not make any sense there, thank your for pointing
this out:)
> Regards,
>
> Marcos Eduardo Matsunaga
>
> Oracle USA
> Linux Engineering
>
> “The statements and opinions expressed here are my own and do not
> necessarily represent those of Oracle Corporation.”
>
>
>
> Tristan Ye wrote:
>> This script will perform a thorough test on refcount for ocfs2 by
>> tunning corresponding single-node testing binary variously. It also
>> was responsible for the testing automation to do logging, env setting etc.
>>
>> Following testcases will be involved.
>>
>> 1. Basic func test
>>
>> 2. Random test
>>
>> 3. Mmap test
>>
>> 4. Concurrent test
>>
>> 5. Boundary test
>>
>> 6. Stress test
>>
>> 7. Xattr combination test
>>
>> Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
>> ---
>> programs/reflink_tests/reflink_test_run.sh | 512 ++++++++++++++++++++++++++++
>> 1 files changed, 512 insertions(+), 0 deletions(-)
>> create mode 100755 programs/reflink_tests/reflink_test_run.sh
>>
>> diff --git a/programs/reflink_tests/reflink_test_run.sh b/programs/reflink_tests/reflink_test_run.sh
>> new file mode 100755
>> index 0000000..235f624
>> --- /dev/null
>> +++ b/programs/reflink_tests/reflink_test_run.sh
>> @@ -0,0 +1,512 @@
>> +#!/bin/bash
>> +#
>> +# vim: noexpandtab sw=8 ts=8 sts=0:
>> +#
>> +# reflink_test_run.sh
>> +#
>> +# description: This script will perform a thorough single-node test on
>> +# refcount for ocfs2. Following testcases will be involved.
>> +#
>> +# 1. Basic func test
>> +#
>> +# 2. Random test
>> +#
>> +# 3. Mmap test
>> +#
>> +# 4. Concurrent test
>> +#
>> +# 5. Boundary test
>> +#
>> +# 6. Stress test
>> +#
>> +# 7. Xattr combination test
>> +#
>> +# Author: Tristan Ye, tristan.ye at oracle.com
>> +#
>> +# History: 18 Mar 2009
>> +#
>> +#
>> +# Copyright (C) 2008 Oracle. All rights reserved.
>> +#
>> +# This program is free software; you can redistribute it and/or
>> +# modify it under the terms of the GNU General Public
>> +# License, version 2, as published by the Free Software Foundation.
>> +#
>> +# his program is distributed in the hope that it will be useful,
>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
>> +# General Public License for more details.
>> +#
>> +
>> +################################################################################
>> +# Global Variables
>> +################################################################################
>> +. ./o2tf.sh
>> +
>> +BINDIR=/work/ocfs2-test-refcount/programs/reflink_tests
>> +
>> +BLOCKSIZE=
>> +CLUSTERSIZE=
>> +SLOTS=4
>> +JOURNALSIZE=0
>> +BLOCKS=0
>> +LABELNAME=ocfs2-refcount-tests
>> +DEVICE=
>> +WORK_PLACE_DIRENT=ocfs2-refcount-tests
>> +WORK_PLACE=
>> +
>> +REFLINK_TEST_BIN="${BINDIR}/reflink_test"
>> +FILL_HOLES_BIN="${BINDIR}/fill_holes"
>> +VERIFY_HOLES_BIN="${BINDIR}/verify_holes"
>> +
>> +DEFAULT_LOG_DIR=${O2TDIR}/log
>> +LOG_DIR=
>> +RUN_LOG_FILE=
>> +LOG_FILE=
>> +
>> +TEST_NO=0
>> +TEST_PASS=0
>> +
>> +set -o pipefail
>> +
>> +################################################################################
>> +# Utility Functions
>> +################################################################################
>> +function f_usage()
>> +{
>> + echo "usage: `basename ${0}` [-o logdir] <-d device> <mountpoint path>"
>> + echo " -o output directory for the logs"
>> + echo " -d block device name used for ocfs2 volume"
>> + echo " <mountpoint path> specify the testing mounting point."
>> + exit 1;
>> +
>> +}
>> +
>> +function f_getoptions()
>> +{
>> + if [ $# -eq 0 ]; then
>> + f_usage;
>> + exit 1
>> + fi
>> +
>> + while getopts "o:hd:" options; do
>> + case $options in
>> + o ) LOG_DIR="$OPTARG";;
>> + d ) DEVICE="$OPTARG";;
>> + h ) f_usage;;
>> + * ) f_usage;;
>> + esac
>> + done
>> + shift $(($OPTIND -1))
>> + MOUNT_POINT=${1}
>> +}
>> +
>> +function f_check()
>> +{
>> + f_getoptions $*
>> +
>> + if [ -z "${MOUNT_POINT}" ];then
>> + f_usage
>> + else
>> + if [ ! -d ${MOUNT_POINT} ]; then
>> + echo "Mount point ${MOUNT_POINT} does not exist."
>> + exit 1
>> + else
>> + if [ "`dirname ${MOUNT_POINT}`" = "/" ]; then
>> + MOUNT_POINT="`dirname ${MOUNT_POINT}``basename \
>> + ${MOUNT_POINT}`"
>> + else
>> + MOUNT_POINT="`dirname ${MOUNT_POINT}`/`basename \
>> + ${MOUNT_POINT}`"
>> + fi
>> + fi
>> + fi
>> +
>> + LOG_DIR=${LOG_DIR:-$DEFAULT_LOG}
>> + ${MKDIR_BIN} -p ${LOG_DIR} || exit 1
>> +
>> + RUN_LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date +%F-%H-\
>> +%M-%S`-reflink-tests-run.log"
>> + LOG_FILE="`dirname ${LOG_DIR}`/`basename ${LOG_DIR}`/`date +%F-%H-\
>> +%M-%S`-reflink-tests.log"
>> + VERIFY_HOLES_LOG_FILE="`dirname ${LOG_DIR}`/`basename \
>> +${LOG_DIR}`/verify-holes.log"
>> +
>> +}
>> +
>> +function f_reflink_bash_utils_test()
>> +{
>> + #${1} specify the reflink_nums
>> + #${2} specfiy the reflink_size
>> + local ref_counts=${1}
>> + local ref_size=${2}
>> + local bs=
>> + local count=
>> + local skip=
>> + local target_pfx=${WORK_PLACE}/copy
>> + local target=
>> + local i=
>> +
>> + local orig=${WORK_PLACE}/orig
>> + local HUNKSIZE=1048576
>> +
>> + for bs in ${BLOCKSIZE} ${CLUSTERSIZE} ${HUNKSIZE};do
>> + count=$((${ref_size}/${bs}))
>> + dd if=/dev/zero of=${orig} bs=${bs} count=${count}
>> + if [ "$?" -ne "0" ]; then
>> + return -1
>> + fi
>> +
>> + for i in $(seq ${ref_counts});do
>> + target=${target_pfx}-${i}
>> + reflink ${orig} ${target}
>> + done
>> +
>> + for i in $(seq ${ref_counts});do
>> + target=${target_pfx}-${i}
>> + skip=$((${RANDOM}%${count}))
>> + dd if=/dev/random of=${target} bs=${bs} count=1 \
>> + seek=${skip}
>> +
>> + if [ "$?" -ne "0" ]; then
>> + return -1
>> + fi
>> + done
>> +
>> + ${RM_BIN} -rf ${target_pfx}*
>> + ${RM_BIN} -rf ${orig}
>> + done
>> +
>> + return 0
>> +}
>> +
>> +function f_fill_and_verify_holes()
>> +{
>> +
>> + #${1} specify the reflink_nums
>> + #${2} specfiy the reflink_size
>> + #${3} specify the hole_nums
>> + local ref_counts=${1}
>> + local ref_size=${2}
>> + local hole_nums=${3}
>> + local orig=${WORK_PLACE}/orig
>> + local target_pfx=${WORK_PLACE}/copy
>> + local target=
>> + local i=
>> +
>> + f_LogMsg ${LOG_FILE} "Fill Holes, CMD:${FILL_HOLES_BIN} -f -o \
>> +${VERIFY_HOLES_LOG_FILE} -i ${hole_nums} ${orig} ${ref_size}"
>> +
>> + ${FILL_HOLES_BIN} -f -o ${VERIFY_HOLES_LOG_FILE} -i ${hole_nums} \
>> +${orig} ${ref_size}
>> +
>> + if [ "$?" -ne "0" ];then
>> + return -1
>> + fi
>> +
>> + f_LogMsg ${LOG_FILE} "Reflink inode with hole to ${ref_counts} reflinks"
>> +
>> + for i in $(seq ${ref_counts});do
>> +
>> + target=${target_pfx}-${i}
>> + reflink ${orig} ${target}
>> +
>> + done
>> +
>> + sync
>> +
>> + f_LogMsg ${LOG_FILE} "Veirfy holes for ${ref_counts} reflinks"
>> + for i in $(seq 1 ${ref_counts});do
>> +
>> + target=${target_pfx}-${i}
>> +
>> + f_LogMsg ${LOG_FILE} "Veirfy holes for reflink[${i}]:${target}"
>> + ${VERIFY_HOLES_BIN} ${VERIFY_HOLES_LOG_FILE} ${target}
>> + if [ "$?" -ne "0" ];then
>> + return -1
>> + fi
>> + done
>> +
>> + f_LogMsg ${LOG_FILE} "Veirfy holes for original file"
>> + ${VERIFY_HOLES_BIN} ${VERIFY_HOLES_LOG_FILE} ${orig} || return -1
>> +
>> + return 0
>> +}
>> +
>> +function f_verify_reflinks_holes()
>> +{
>> + #${1} specify the reflink_nums
>> +
>> + local ref_counts=${1}
>> + local orig=${WORK_PLACE}/original_xattr_holes_refile
>> + local target=
>> + local i=
>> + local logfile=
>> +
>> + f_LogMsg ${LOG_FILE} "Veirfy holes for ${ref_counts} reflinked files"
>> + for i in $(seq 0 ${ref_counts});do
>> + if [ "${i}" -eq "${ref_counts}" ];then
>> + target=${orig}
>> + logfile=${VERIFY_HOLES_LOG_FILE}
>> +
>> + else
>> + target=${orig}r${i}
>> + logfile=${VERIFY_HOLES_LOG_FILE}r${i}
>> + fi
>> +
>> + f_LogMsg ${LOG_FILE} "Veirfy holes for reflink[${i}]:${target} \
>> +from logfile ${logfile}"
>> +
>> + ${VERIFY_HOLES_BIN} ${logfile} ${target}
>> +
>> + if [ "$?" -ne "0" ];then
>> + return -1
>> + fi
>> + done
>> +}
>> +
>> +function f_runtest()
>> +{
>> + f_LogRunMsg ${RUN_LOG_FILE} "[*] Mkfs device ${DEVICE}:"
>> + f_mkfs ${LOG_FILE} ${BLOCKSIZE} ${CLUSTERSIZE} ${LABELNAME} ${SLOTS} \
>> +${DEVICE} "refcount,xattr" ${JOURNALSIZE} ${BLOCKS}
>> + RET=$?
>> + f_echo_status ${RET}| tee -a ${RUN_LOG_FILE}
>> + f_exit_or_not ${RET}
>> +
>> + f_LogRunMsg ${RUN_LOG_FILE} "[*] Mount ${DEVICE} to ${MOUNT_POINT}:"
>> + f_mount ${LOG_FILE} ${DEVICE} ${MOUNT_POINT} ocfs2
>> + RET=$?
>> + f_echo_status ${RET}| tee -a ${RUN_LOG_FILE}
>> + f_exit_or_not ${RET}
>> +
>> + WORK_PLACE=${MOUNT_POINT}/${WORK_PLACE_DIRENT}
>> + ${MKDIR_BIN} -p ${WORK_PLACE}
>> +
>> + ((TEST_NO++))
>> + f_LogRunMsg ${RUN_LOG_FILE} "[${TEST_NO}] Basic Fucntional Test:"
>> + f_LogMsg ${LOG_FILE} "[${TEST_NO}] Basic Fucntional Test, CMD:${SUDO} \
>> +${REFLINK_TEST_BIN} -i 1 -n 1000 -l 104857600 -d ${DEVICE} -w ${WORK_PLACE} -f"
>> + ${SUDO} ${REFLINK_TEST_BIN} -i 1 -n 100 -l 10485760 -d ${DEVICE} -w \
>> +${WORK_PLACE} -f >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_echo_status ${RET} | tee -a ${RUN_LOG_FILE}
>> + f_exit_or_not ${RET}
>> + ((TEST_PASS++))
>> + f_LogMsg ${LOG_FILE} "Cleanup working place"
>> + ${SUDO} ${CHMOD_BIN} -R 777 ${MOUNT_POINT} >>${LOG_FILE} 2>&1
>> + ${RM_BIN} -rf ${WORK_PLACE}/* >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_exit_or_not ${RET}
>> +
>> + ((TEST_NO++))
>> + f_LogRunMsg ${RUN_LOG_FILE} "[${TEST_NO}] Random Refcount Test:"
>> + f_LogMsg ${LOG_FILE} "[${TEST_NO}] Random Refcount Test, CMD:${SUDO} \
>> +${REFLINK_TEST_BIN} -i 1 -n 1000 -l 104857600 -d ${DEVICE} -w ${WORK_PLACE} -f -r"
>> + ${SUDO} ${REFLINK_TEST_BIN} -i 1 -n 100 -l 10485760 -d ${DEVICE} -w \
>> +${WORK_PLACE} -r>>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_echo_status ${RET} | tee -a ${RUN_LOG_FILE}
>> + f_exit_or_not ${RET}
>> + ((TEST_PASS++))
>> + f_LogMsg ${LOG_FILE} "Cleanup working place"
>> + ${SUDO} ${CHMOD_BIN} -R 777 ${MOUNT_POINT} >>${LOG_FILE} 2>&1
>> + ${RM_BIN} -rf ${WORK_PLACE}/* >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_exit_or_not ${RET}
>> +
>> + ((TEST_NO++))
>> + f_LogRunMsg ${RUN_LOG_FILE} "[${TEST_NO}] Mmap Refcount Test:"
>> + f_LogMsg ${LOG_FILE} "[${TEST_NO}] Mmap Refcount Test, CMD:${SUDO} \
>> +${REFLINK_TEST_BIN} -i 1 -n 1000 -l 104857600 -d ${DEVICE} -w ${WORK_PLACE} -m"
>> + ${SUDO} ${REFLINK_TEST_BIN} -i 1 -n 100 -l 10485760 -d ${DEVICE} -w \
>> +${WORK_PLACE} -m>>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_echo_status ${RET} | tee -a ${RUN_LOG_FILE}
>> + f_exit_or_not ${RET}
>> + ((TEST_PASS++))
>> + f_LogMsg ${LOG_FILE} "Cleanup working place"
>> + ${SUDO} ${CHMOD_BIN} -R 777 ${MOUNT_POINT} >>${LOG_FILE} 2>&1
>> + ${RM_BIN} -rf ${WORK_PLACE}/* >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_exit_or_not ${RET}
>> +
>> + ((TEST_NO++))
>> + f_LogRunMsg ${RUN_LOG_FILE} "[${TEST_NO}] Boundary Refcount Test:"
>> + f_LogMsg ${LOG_FILE} "[${TEST_NO}] Boundary Refcount Test, CMD:${SUDO} \
>> +${REFLINK_TEST_BIN} -i 1 -d ${DEVICE} -w ${WORK_PLACE} -b"
>> + ${SUDO} ${REFLINK_TEST_BIN} -i 1 -d ${DEVICE} -w \
>> +${WORK_PLACE} -b>>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_echo_status ${RET} | tee -a ${RUN_LOG_FILE}
>> + f_exit_or_not ${RET}
>> + ((TEST_PASS++))
>> + f_LogMsg ${LOG_FILE} "Cleanup working place"
>> + ${SUDO} ${CHMOD_BIN} -R 777 ${MOUNT_POINT} >>${LOG_FILE} 2>&1
>> + ${RM_BIN} -rf ${WORK_PLACE}/* >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_exit_or_not ${RET}
>> +
>> + ((TEST_NO++))
>> + f_LogRunMsg ${RUN_LOG_FILE} "[${TEST_NO}] Concurrent Refcount Test:"
>> + f_LogMsg ${LOG_FILE} "[${TEST_NO}] Concurrent Refcount Test, \
>> +CMD:${SUDO} ${REFLINK_TEST_BIN} -i 1 -n 1000 -l 104857600 -d ${DEVICE} \
>> +-w ${WORK_PLACE} -c 100"
>> + ${SUDO} ${REFLINK_TEST_BIN} -i 1 -n 100 -l 10485760 -d ${DEVICE} -w \
>> +${WORK_PLACE} -c 40 >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_echo_status ${RET} | tee -a ${RUN_LOG_FILE}
>> + f_exit_or_not ${RET}
>> + ((TEST_PASS++))
>> + f_LogMsg ${LOG_FILE} "Cleanup working place"
>> + ${SUDO} ${CHMOD_BIN} -R 777 ${MOUNT_POINT} >>${LOG_FILE} 2>&1
>> + ${RM_BIN} -rf ${WORK_PLACE}/* >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_exit_or_not ${RET}
>> +
>> + ((TEST_NO++))
>> + f_LogRunMsg ${RUN_LOG_FILE} "[${TEST_NO}] Bash & Tools Utility Test:"
>> + f_reflink_bash_utils_test 100 104857600 >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_echo_status ${RET} | tee -a ${RUN_LOG_FILE}
>> + f_exit_or_not ${RET}
>> + ((TEST_PASS++))
>> + f_LogMsg ${LOG_FILE} "Cleanup working place"
>> + ${SUDO} ${CHMOD_BIN} -R 777 ${MOUNT_POINT} >>${LOG_FILE} 2>&1
>> + ${RM_BIN} -rf ${WORK_PLACE}/* >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_exit_or_not ${RET}
>> +
>> + ((TEST_NO++))
>> + f_LogRunMsg ${RUN_LOG_FILE} "[${TEST_NO}] Reflinks With Holes Test:"
>> + f_fill_and_verify_holes 10 10485760 1000 >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_echo_status ${RET} | tee -a ${RUN_LOG_FILE}
>> + f_exit_or_not ${RET}
>> + ((TEST_PASS++))
>> + f_LogMsg ${LOG_FILE} "Cleanup working place"
>> + ${SUDO} ${CHMOD_BIN} -R 777 ${MOUNT_POINT} >>${LOG_FILE} 2>&1
>> + ${RM_BIN} -rf ${WORK_PLACE}/* >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_exit_or_not ${RET}
>> +
>> + ((TEST_NO++))
>> + f_LogRunMsg ${RUN_LOG_FILE} "[${TEST_NO}] Xattr Refcount Test:"
>> + f_LogMsg ${LOG_FILE} "[${TEST_NO}] Xattr Refcount Test, CMD:${SUDO} \
>> +${REFLINK_TEST_BIN} -i 10 -n 10000 -l 10485760 -d ${DEVICE} -w ${WORK_PLACE} \
>> +-x 10000"
>> + ${SUDO} ${REFLINK_TEST_BIN} -i 1 -n 100 -l 10485760 -d ${DEVICE} -w \
>> +${WORK_PLACE} -x 10000 >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_echo_status ${RET} | tee -a ${RUN_LOG_FILE}
>> + f_exit_or_not ${RET}
>> + ((TEST_PASS++))
>> + f_LogMsg ${LOG_FILE} "Cleanup working place"
>> + ${SUDO} ${CHMOD_BIN} -R 777 ${MOUNT_POINT} >>${LOG_FILE} 2>&1
>> + ${RM_BIN} -rf ${WORK_PLACE}/* >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_exit_or_not ${RET}
>> +
>> + ((TEST_NO++))
>> + f_LogRunMsg ${RUN_LOG_FILE} "[${TEST_NO}] Stress Refcount Test:"
>> + f_LogMsg ${LOG_FILE} "[${TEST_NO}] Stress Refcount Test, CMD:${SUDO} \
>> +${REFLINK_TEST_BIN} -i 10 -n 20 -l 2048576000 -p 10000 -d ${DEVICE} -w \
>> +${WORK_PLACE} -s"
>> + ${SUDO} ${REFLINK_TEST_BIN} -i 1 -n 10000 -l 1048576000 -p 20000 -d \
>> +${DEVICE} -w ${WORK_PLACE} -s >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_echo_status ${RET} | tee -a ${RUN_LOG_FILE}
>> + f_exit_or_not ${RET}
>> + ((TEST_PASS++))
>> + f_LogMsg ${LOG_FILE} "Cleanup working place"
>> + ${SUDO} ${CHMOD_BIN} -R 777 ${MOUNT_POINT} >>${LOG_FILE} 2>&1
>> + ${RM_BIN} -rf ${WORK_PLACE}/* >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_exit_or_not ${RET}
>> +
>> + ((TEST_NO++))
>> + f_LogRunMsg ${RUN_LOG_FILE} "[${TEST_NO}] OracleVM Simulation Test:"
>> + f_LogMsg ${LOG_FILE} "[${TEST_NO}] OracleVM Simulation Test, CMD:\
>> +${SUDO} ${REFLINK_TEST_BIN} -i 10 -n 2 -l 10485760000 -p 1000 -d ${DEVICE} -w \
>> +${WORK_PLACE} -s"
>> + ${SUDO} ${REFLINK_TEST_BIN} -i 1 -n 10 -l 20485760000 -p 1000 -d \
>> +${DEVICE} -w ${WORK_PLACE} -s>>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_echo_status ${RET} | tee -a ${RUN_LOG_FILE}
>> + f_exit_or_not ${RET}
>> + ((TEST_PASS++))
>> + f_LogMsg ${LOG_FILE} "Cleanup working place"
>> + ${SUDO} ${CHMOD_BIN} -R 777 ${MOUNT_POINT} >>${LOG_FILE} 2>&1
>> + ${RM_BIN} -rf ${WORK_PLACE}/* >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_exit_or_not ${RET}
>> +
>> + exit 0
>> +
>> + ((TEST_NO++))
>> + f_LogRunMsg ${RUN_LOG_FILE} "[${TEST_NO}] Destructive Refcount Test:"
>> + #fillup the volume
>> + f_LogMsg ${LOG_FILE} "[${TEST_NO}] Destructive Refcount Test, CMD:\
>> +${SUDO} ${REFLINK_TEST_BIN} -i 10 -n 2 -l 10485760000 -p 1000 -d ${DEVICE} \
>> +-w ${WORK_PLACE} -s"
>> + ${SUDO} ${REFLINK_TEST_BIN} -i 1 -n 2 -l 10485760000 -p 1000 -d \
>> +${DEVICE} -w ${WORK_PLACE} -s>>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_echo_status ${RET} | tee -a ${RUN_LOG_FILE}
>> + f_exit_or_not ${RET}
>> + ((TEST_PASS++))
>> + f_LogMsg ${LOG_FILE} "Cleanup working place"
>> + ${SUDO} ${CHMOD_BIN} -R 777 ${MOUNT_POINT} >>${LOG_FILE} 2>&1
>> + ${RM_BIN} -rf ${WORK_PLACE}/* >>${LOG_FILE} 2>&1
>> + RET=$?
>> + f_exit_or_not ${RET}
>> +
>> + f_LogRunMsg ${RUN_LOG_FILE} "[*] Umount device ${DEVICE} from ${MOUNT_POINT}:"
>> + f_umount ${LOG_FILE} ${MOUNT_POINT}
>> + RET=$?
>> + f_echo_status ${RET}| tee -a ${RUN_LOG_FILE}
>> + f_exit_or_not ${RET}
>> +}
>> +
>> +function f_cleanup()
>> +{
>> + :
>> +}
>> +
>> +################################################################################
>> +# Main Entry
>> +################################################################################
>> +
>> +#redfine the int signal hander
>> +trap 'echo -ne "\n\n">>${RUN_LOG_FILE};echo "Interrupted by Ctrl+C,Cleanuping\
>> +... "|tee -a ${RUN_LOG_FILE}; f_cleanup;exit 1' SIGINT
>> +
>> +f_check $*
>> +
>> +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 BLOCKSIZE in 4096;do
>> + #for CLUSTERSIZE in 4096 32768 1048576;do
>> + for CLUSTERSIZE in 32768;do
>> + f_LogRunMsg ${RUN_LOG_FILE} "<- Running test with ${BLOCKSIZE} \
>> +bs and ${CLUSTERSIZE} cs ->\n"
>> + f_LogMsg ${LOG_FILE} "<- Running test with ${BLOCKSIZE} bs \
>> +and ${CLUSTERSIZE} cs ->"
>> + f_runtest
>> + done
>> +done
>> +
>> +END_TIME=${SECONDS}
>> +f_LogRunMsg ${RUN_LOG_FILE} "=====================Reflink tests end: `date`\
>> +=====================\n"
>> +f_LogMsg ${LOG_FILE} "=====================Reflink dirs tests end: `date`\
>> +====================="
>> +
>> +f_LogRunMsg ${RUN_LOG_FILE} "Time elapsed(s): $((${END_TIME}-${START_TIME}))\n"
>> +f_LogRunMsg ${RUN_LOG_FILE} "Tests total: ${TEST_NO}\n"
>> +f_LogRunMsg ${RUN_LOG_FILE} "Tests passed: ${TEST_PASS}\n"
>>
More information about the Ocfs2-test-devel
mailing list