Whamcloud - gitweb
LU-7558 ptlrpc: connect vs import invalidate race
[fs/lustre-release.git] / lustre / tests / functions.sh
index 92dd853..72ea7db 100644 (file)
@@ -619,7 +619,8 @@ run_ior() {
        # mpi_run uses mpiuser
        chmod 0777 $testdir
        if [ -z "$NFSCLIENT" ]; then
-               $LFS setstripe $testdir -c -1 ||
+               ior_stripe_params=${ior_stripe_params:-"-c -1"}
+               $LFS setstripe $testdir $ior_stripe_params ||
                        { error "setstripe failed" && return 2; }
        fi
 
@@ -635,9 +636,14 @@ run_ior() {
        # -T    maxTimeDuration -- max time in minutes to run tests"
        # -k    keepFile -- keep testFile(s) on program exit
 
-       local cmd="$IOR -a $ior_type -b ${ior_blockSize}${ior_blockUnit} \
+       local cmd
+       if [ -n "$ior_custom_params" ]; then
+               cmd="$IOR $ior_custom_params -o $testdir/iorData"
+       else
+               cmd="$IOR -a $ior_type -b ${ior_blockSize}${ior_blockUnit} \
                -o $testdir/iorData -t $ior_xferSize -v -C -w -r -W \
                -i $ior_iteration -T $ior_DURATION -k"
+       fi
 
        [ $type = "fpp" ] && cmd="$cmd -F"
 
@@ -648,8 +654,9 @@ run_ior() {
                        -n $((num_clients * ior_THREADS)) -p $SRUN_PARTITION \
                        -- $cmd
        else
+               mpi_ior_custom_threads=${mpi_ior_custom_threads:-"$((num_clients * ior_THREADS))"}
                mpi_run ${MACHINEFILE_OPTION} ${MACHINEFILE} \
-                       -np $((num_clients * $ior_THREADS)) $cmd
+                       -np $mpi_ior_custom_threads $cmd
        fi
 
     local rc=$?
@@ -1029,9 +1036,9 @@ run_rr_alloc() {
        # Save mdt values, set threshold to 100% i.e always Round Robin,
        # restore the saved values again after creating files...
        save_lustre_params mds1 \
-               "lov.lustre-MDT0000*.qos_threshold_rr" > $qos_prec_objs
+               "lov.$FSNAME-MDT0000*.qos_threshold_rr" > $qos_prec_objs
        save_lustre_params mds1 \
-               "osp.lustre-OST*-osc-MDT0000.create_count" >> $qos_prec_objs
+               "osp.$FSNAME-OST*-osc-MDT0000.create_count" >> $qos_prec_objs
 
        local old_create_count=$(grep -e "create_count" $qos_prec_objs |
                cut -d'=' -f 2 | sort -nr | head -n1)
@@ -1046,8 +1053,8 @@ run_rr_alloc() {
        foeo_calc=$((rr_alloc_NFILES * total_MNTPTS / OSTCOUNT))
        local create_count=$((2 * foeo_calc))
        do_facet mds1 "$LCTL set_param -n \
-               lov.lustre-MDT0000*.qos_threshold_rr 100 \
-               osp.lustre-OST*-osc-MDT0000.create_count $create_count" ||
+               lov.$FSNAME-MDT0000*.qos_threshold_rr 100 \
+               osp.$FSNAME-OST*-osc-MDT0000.create_count $create_count" ||
                error "failed while setting qos_threshold_rr & creat_count"
 
        # Create few temporary files in order to increase the precreated objects