From eb205c6e624008d7e4aa0db40464e2a1eec64205 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 20 Jan 2009 14:32:02 -0800 Subject: [PATCH] Update zpios to use zpool-create -d arg, and zpios-start/stop --- .../{small.cfg => 1th-16rc-4rs-1cs-4off.sh} | 14 ++++++-- scripts/zpios-test/tiny.sh | 1 + scripts/zpios.sh | 36 +++++++------------ 3 files changed, 24 insertions(+), 27 deletions(-) rename scripts/zpios-test/{small.cfg => 1th-16rc-4rs-1cs-4off.sh} (91%) create mode 120000 scripts/zpios-test/tiny.sh diff --git a/scripts/zpios-test/small.cfg b/scripts/zpios-test/1th-16rc-4rs-1cs-4off.sh similarity index 91% rename from scripts/zpios-test/small.cfg rename to scripts/zpios-test/1th-16rc-4rs-1cs-4off.sh index 35dbf016df..61f85253b2 100755 --- a/scripts/zpios-test/small.cfg +++ b/scripts/zpios-test/1th-16rc-4rs-1cs-4off.sh @@ -39,12 +39,20 @@ ZPIOS_CMD="${CMDDIR}/zpios/zpios \ --load=dmuio \ --path=zpios \ - --chunksize=1M \ + --threadcount=1 \ + --regioncount=16 \ --regionsize=4M \ - --regioncount=256 \ - --threadcount=4 \ + --chunksize=1M \ --offset=4M \ --cleanup \ --verbose \ --human-readable \ ${ZPIOS_OPTIONS}" + +zpios_start() { + echo ${ZPIOS_CMD} + $ZPIOS_CMD || exit 1 +} + +zpios_stop() { +} diff --git a/scripts/zpios-test/tiny.sh b/scripts/zpios-test/tiny.sh new file mode 120000 index 0000000000..ba8b7cd0c1 --- /dev/null +++ b/scripts/zpios-test/tiny.sh @@ -0,0 +1 @@ +1th-16rc-4rs-1cs-4off.sh \ No newline at end of file diff --git a/scripts/zpios.sh b/scripts/zpios.sh index 49165c3562..8d452522d9 100755 --- a/scripts/zpios.sh +++ b/scripts/zpios.sh @@ -95,11 +95,11 @@ print_stats() { check_test() { if [ ! -f ${ZPIOS_TEST} ]; then - local NAME=`basename ${ZPIOS_TEST} .cfg` + local NAME=`basename ${ZPIOS_TEST} .sh` ERROR="Unknown test '${NAME}', available tests are:\n" for TST in `ls ${TOPDIR}/scripts/zpios-test/`; do - local NAME=`basename ${TST} .cfg` + local NAME=`basename ${TST} .sh` ERROR="${ERROR}${NAME}\n" done @@ -110,8 +110,8 @@ check_test() { } PROFILE= -ZPOOL_CONFIG=zpool-config.cfg -ZPIOS_TEST=zpios-test.cfg +ZPOOL_CONFIG=zpool-config.sh +ZPIOS_TEST=zpios-test.sh ZPOOL_NAME=zpios while getopts 'hvpc:t:' OPTION; do @@ -131,7 +131,7 @@ while getopts 'hvpc:t:' OPTION; do ZPOOL_CONFIG=${OPTARG} ;; t) - ZPIOS_TEST=${TOPDIR}/scripts/zpios-test/${OPTARG}.cfg + ZPIOS_TEST=${TOPDIR}/scripts/zpios-test/${OPTARG}.sh ;; ?) usage @@ -144,8 +144,9 @@ if [ $(id -u) != 0 ]; then die "Must run as root" fi -# Validate your using a known test +# Validate and source your test config check_test || die "${ERROR}" +. ${ZPIOS_TEST} # Pull in the zpios test module is not loaded. If this fails it is # likely because the full module stack was not yet loaded with zfs.sh @@ -168,14 +169,6 @@ fi # Create the zpool configuration ./zpool-create.sh ${VERBOSE_FLAG} -p ${ZPOOL_NAME} -c ${ZPOOL_CONFIG} || exit 1 -if [ -n "${ZPIOS_PRE}" ]; then - msg "Executing ${ZPIOS_PRE}" - ${ZPIOS_PRE} || exit 1 -fi - -# Source the zpios test configuration -. ${ZPIOS_TEST} - if [ $PROFILE ]; then ZPIOS_CMD="${ZPIOS_CMD} --log=${PROFILE_ZPIOS_LOG}" ZPIOS_CMD="${ZPIOS_CMD} --prerun=${PROFILE_ZPIOS_PRE}" @@ -184,19 +177,14 @@ fi echo date -echo ${ZPIOS_CMD} -$ZPIOS_CMD || exit 1 - +zpios_start +zpios_stop print_stats -if [ -n "${ZPIOS_POST}" ]; then - msg "Executing ${ZPIOS_POST}" - ${ZPIOS_POST} || exit 1 -fi - -msg "${CMDDIR}/zpool/zpool destroy ${ZPOOL_NAME}" -${CMDDIR}/zpool/zpool destroy ${ZPOOL_NAME} +# Destroy the zpool configuration +./zpool-create.sh ${VERBOSE_FLAG} -p ${ZPOOL_NAME} -c ${ZPOOL_CONFIG} -d || exit 1 +# Unload the test module stack unload_modules exit 0