Whamcloud - gitweb
LU-10059 tests: sanityn 32a error messages
[fs/lustre-release.git] / lustre / tests / mdsrate-lookup-1dir.sh
index 12f36ce..221a405 100644 (file)
@@ -9,13 +9,12 @@
 # perform lookups for 10 minutes. This test can be run from a single node for
 # #1 and from all nodes for #2 aggregate test to measure lookup performance.
 
-LUSTRE=${LUSTRE:-`dirname $0`/..}
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
+
 assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
 
-MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
 # Do not use name [df][0-9]* to avoid cleanup by rm, bug 18045
 BASEDIR=$MOUNT/mdsrate
 TESTDIR=$BASEDIR/lookup
@@ -39,8 +38,8 @@ check_and_setup_lustre
 
 mkdir -p $BASEDIR
 chmod 0777 $BASEDIR
-$LFS setstripe $BASEDIR -c 1
-get_stripe $BASEDIR
+mdsrate_STRIPEPARAMS=${mdsrate_STRIPEPARAMS:-${fs_STRIPEPARAMS:-"-c 1"}}
+setstripe_getstripe $BASEDIR $mdsrate_STRIPEPARAMS
 
 IFree=$(mdsrate_inodes_available)
 if [ $IFree -lt $NUM_FILES ]; then
@@ -67,8 +66,13 @@ else
        mpi_run ${MACHINEFILE_OPTION} ${MACHINEFILE} -np ${NUM_THREADS} \
                ${COMMAND} 2>&1
 
-    # No lockup if error occurs on file creation, abort.
-    [ ${PIPESTATUS[0]} != 0 ] && error "mdsrate file creation failed, aborting"
+       # No lockup if error occurs on file creation, abort.
+       if [ ${PIPESTATUS[0]} != 0 ]; then
+               error_noexit "mdsrate file creation failed, aborting"
+               mdsrate_cleanup $NUM_THREADS $MACHINEFILE $NUM_FILES \
+                               $TESTDIR 'f%%d' --ignore
+               exit 1
+       fi
 fi
 
 COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --lookup --time ${TIME_PERIOD} ${SEED_OPTION}
@@ -83,10 +87,13 @@ else
        mpi_run ${MACHINEFILE_OPTION} ${MACHINEFILE} -np 1 ${COMMAND} |
                tee ${LOG}
 
-    if [ ${PIPESTATUS[0]} != 0 ]; then
-        [ -f $LOG ] && sed -e "s/^/log: /" $LOG
-        error "mdsrate lookups on a single client failed, aborting"
-    fi
+       if [ ${PIPESTATUS[0]} != 0 ]; then
+               [ -f $LOG ] && sed -e "s/^/log: /" $LOG
+               error_noexit "mdsrate lookup on single client failed, aborting"
+               mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES \
+                               $TESTDIR 'f%%d' --ignore
+               exit 1
+       fi
 fi
 
 # 2
@@ -99,10 +106,13 @@ else
        mpi_run ${MACHINEFILE_OPTION} ${MACHINEFILE} -np ${NUM_CLIENTS} \
                ${COMMAND} | tee ${LOG}
 
-    if [ ${PIPESTATUS[0]} != 0 ]; then
-        [ -f $LOG ] && sed -e "s/^/log: /" $LOG
-        error "mdsrate lookups on multiple nodes failed, aborting"
-    fi
+       if [ ${PIPESTATUS[0]} != 0 ]; then
+               [ -f $LOG ] && sed -e "s/^/log: /" $LOG
+               error_noexit "mdsrate lookup on multiple nodes failed, aborting"
+               mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES \
+                               $TESTDIR 'f%%d' --ignore
+               exit 1
+       fi
 fi
 
 complete $SECONDS