From: grev Date: Fri, 13 Mar 2009 19:25:07 +0000 (+0000) Subject: b=18045 X-Git-Tag: v1_6_7_1~27 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=127b9018749d14666ba040b23c2135a0c77b6356;p=fs%2Flustre-release.git b=18045 i=Adilger new mdsrate --ignore option for mdsrate tests cleanup --- diff --git a/lustre/tests/mdsrate-create-large.sh b/lustre/tests/mdsrate-create-large.sh index b45dae1..94bb805 100644 --- a/lustre/tests/mdsrate-create-large.sh +++ b/lustre/tests/mdsrate-create-large.sh @@ -48,6 +48,9 @@ rm -f ${LOG} PI* if [ -n "$NOSINGLE" ]; then echo "NO Test for creates for a single client." else + # We can use np = $NUM_CLIENTS to speed up the cleanup + mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_SINGLE 'f%%d' --ignore + log "===== $0 ### 1 NODE CREATE ###" echo "Running creates on 1 node(s)." @@ -83,6 +86,7 @@ fi if [ -n "$NOMULTI" ]; then echo "NO test for create on multiple nodes." else + mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_MULTI 'f%%d' --ignore log "===== $0 ### $NUM_CLIENTS NODES CREATE ###" echo "Running creates on ${NUM_CLIENTS} node(s)." @@ -112,6 +116,8 @@ else fi equals_msg `basename $0`: test complete, cleaning up +mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_SINGLE 'f%%d' --ignore +mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_MULTI 'f%%d' --ignore rm -f $MACHINEFILE check_and_cleanup_lustre #rm -f $LOG diff --git a/lustre/tests/mdsrate-create-small.sh b/lustre/tests/mdsrate-create-small.sh index 5455796..cb4a1c0 100644 --- a/lustre/tests/mdsrate-create-small.sh +++ b/lustre/tests/mdsrate-create-small.sh @@ -56,7 +56,8 @@ else if [ -n "$NOCREATE" ]; then echo "NO Test for creates for a single client." else - do_node ${CLIENT} "rm -rf $TESTDIR_SINGLE" + # We can use np = $NUM_CLIENTS to speed up the cleanup + mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_SINGLE 'f%%d' --ignore log "===== $0 ### 1 NODE CREATE ###" echo "Running creates on 1 node(s)." @@ -101,7 +102,7 @@ else if [ -n "$NOCREATE" ]; then echo "NO test for create on multiple nodes." else - do_node $CLIENT rm -rf $TESTDIR_MULTI + mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_MULTI 'f%%d' --ignore log "===== $0 ### $NUM_CLIENTS NODES CREATE ###" echo "Running creates on ${NUM_CLIENTS} node(s) with $THREADS_PER_CLIENT threads per client." @@ -136,6 +137,8 @@ else fi equals_msg `basename $0`: test complete, cleaning up +mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_SINGLE 'f%%d' --ignore +mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_MULTI 'f%%d' --ignore rm -f $MACHINEFILE check_and_cleanup_lustre #rm -f $LOG diff --git a/lustre/tests/mdsrate-lookup-1dir.sh b/lustre/tests/mdsrate-lookup-1dir.sh index d529bc6..6276fc4 100644 --- a/lustre/tests/mdsrate-lookup-1dir.sh +++ b/lustre/tests/mdsrate-lookup-1dir.sh @@ -16,7 +16,8 @@ init_test_env $@ assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines} -TESTDIR=$MOUNT +# Do not use name [df][0-9]* to avoid cleanup by rm, bug 18045 +TESTDIR=$MOUNT/mdsrate # Requirements NUM_FILES=${NUM_FILES:-1000000} @@ -34,6 +35,8 @@ rm -f $LOG log "===== $0 ====== " check_and_setup_lustre +mkdir -p $TESTDIR +chmod 0777 $TESTDIR IFree=$(inodes_available) if [ $IFree -lt $NUM_FILES ]; then @@ -48,6 +51,8 @@ get_stripe $TESTDIR if [ -n "$NOCREATE" ]; then echo "NOCREATE=$NOCREATE => no file creation." else + mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' --ignore + log "===== $0 Test preparation: creating ${NUM_FILES} files." echo "Test preparation: creating ${NUM_FILES} files." diff --git a/lustre/tests/mdsrate-stat-large.sh b/lustre/tests/mdsrate-stat-large.sh index 63d41ab..5299fc5 100644 --- a/lustre/tests/mdsrate-stat-large.sh +++ b/lustre/tests/mdsrate-stat-large.sh @@ -18,7 +18,8 @@ init_test_env $@ assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines} -TESTDIR=$MOUNT +# Do not use name [df][0-9]* to avoid cleanup by rm, bug 18045 +TESTDIR=$MOUNT/mdsrate # Requirements NUM_FILES=${NUM_FILES:-1000000} @@ -39,6 +40,8 @@ rm -f $LOG log "===== $0 ====== " check_and_setup_lustre +mkdir -p $TESTDIR +chmod 0777 $TESTDIR IFree=$(inodes_available) if [ $IFree -lt $NUM_FILES ]; then @@ -53,6 +56,8 @@ get_stripe $TESTDIR if [ -n "$NOCREATE" ]; then echo "NOCREATE=$NOCREATE => no file creation." else + mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' --ignore + log "===== $0 Test preparation: creating ${NUM_FILES} files." echo "Test preparation: creating ${NUM_FILES} files." diff --git a/lustre/tests/mdsrate-stat-small.sh b/lustre/tests/mdsrate-stat-small.sh index 2601d7c..355f408 100644 --- a/lustre/tests/mdsrate-stat-small.sh +++ b/lustre/tests/mdsrate-stat-small.sh @@ -18,7 +18,8 @@ init_test_env $@ assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines} -TESTDIR=$MOUNT +# Do not use name [df][0-9]* to avoid cleanup by rm, bug 18045 +TESTDIR=$MOUNT/mdsrate # Requirements NUM_FILES=${NUM_FILES:-1000000} @@ -39,6 +40,8 @@ rm -f $LOG log "===== $0 ====== " check_and_setup_lustre +mkdir -p $TESTDIR +chmod 0777 $TESTDIR IFree=$(inodes_available) if [ $IFree -lt $NUM_FILES ]; then @@ -53,6 +56,8 @@ get_stripe $TESTDIR if [ -n "$NOCREATE" ]; then echo "NOCREATE=$NOCREATE => no file creation." else + mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' --ignore + log "===== $0 Test preparation: creating ${NUM_FILES} files." echo "Test preparation: creating ${NUM_FILES} files." diff --git a/lustre/tests/mdsrate.c b/lustre/tests/mdsrate.c index 6a92a24..44e0b79 100644 --- a/lustre/tests/mdsrate.c +++ b/lustre/tests/mdsrate.c @@ -59,6 +59,7 @@ enum { RANDOM = 'A', READDIR = 'B', RECREATE = 'C', + IGNORE = 'E', VERBOSE = 'V', DEBUG = 'v', HELP = 'h', @@ -85,6 +86,7 @@ struct option longOpts[] = { {"random_order", 0, NULL, RANDOM }, {"readdir_order", 0, NULL, READDIR }, {"recreate", 0, NULL, RECREATE }, + {"ignore", 0, NULL, IGNORE }, {"verbose", 0, NULL, VERBOSE }, {"debug", 0, NULL, DEBUG }, {"help", 0, NULL, HELP }, @@ -123,6 +125,7 @@ struct sigaction act; int order = RANDOM; int seed; int recreate; +int ignore; int verbose; int debug; struct stat statbuf; @@ -149,7 +152,7 @@ struct stat statbuf; char *usage_msg = "usage: %s\n" " { --create [ --noexcl ] | --lookup | --mknod |\n" - " --open | --stat | --unlink [ --recreate ] }\n" + " --open | --stat | --unlink [ --recreate ] [ --ignore ] }\n" " [ --help ] [ --verbose ] [ --debug ]\n" " { [ --begin ] --nfiles }\n" " [ --iters ] [ --time ]\n" @@ -402,6 +405,9 @@ process_args(int argc, char *argv[]) } order = c; break; + case IGNORE: + ++ignore; + break; case DEBUG: ++debug; case VERBOSE: @@ -566,7 +572,7 @@ main(int argc, char *argv[]) /* if we're not measuring creation rates then precreate * the files we're operating on. */ - if ((mode != CREATE) && (mode != MKNOD)) { + if ((mode != CREATE) && (mode != MKNOD) && !ignore) { /* create the files in reverse order. When we encounter * a file that already exists, assume the remainder of * the files exist to save time. The timed performance @@ -722,6 +728,8 @@ main(int argc, char *argv[]) if (rc) { if (((rc = errno) == EINTR) && alarm_caught) break; + if (((rc = errno) == ENOENT) && ignore) + continue; fatal(myrank, "unlink(%s) error: %s\n", filename, strerror(rc)); } diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index fe0726b..6e69922 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1945,6 +1945,6 @@ mpi_run () { } mdsrate_cleanup () { - mpi_run -np $1 -machinefile $2 ${MDSRATE} --unlink --nfiles $3 --dir $4 --filefmt $5 + mpi_run -np $1 -machinefile $2 ${MDSRATE} --unlink --nfiles $3 --dir $4 --filefmt $5 $6 }