X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Flarge-scale.sh;h=9fd35a76434f51828fa85f5c13bf878d4d04b5e5;hb=225e7b8c70fb68bc3aa3a6d88c5e9bda322c9cc9;hp=96142907926c0c54dd9117fa548959a57872ad04;hpb=e4cf956f93a4384d19ea73e601a6651710703492;p=fs%2Flustre-release.git diff --git a/lustre/tests/large-scale.sh b/lustre/tests/large-scale.sh index 9614290..9fd35a7 100644 --- a/lustre/tests/large-scale.sh +++ b/lustre/tests/large-scale.sh @@ -1,4 +1,6 @@ #!/bin/bash +# -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*- +# vim:shiftwidth=4:softtabstop=4:tabstop=4: set -e @@ -17,13 +19,12 @@ init_test_env $@ . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} init_logging -remote_mds_nodsh && log "SKIP: remote MDS with nodsh" && exit 0 +remote_mds_nodsh && skip "remote MDS with nodsh" -[ -n "$CLIENTS" ] || { skip_env "$0: Need two or more clients" && exit 0; } -[ $CLIENTCOUNT -ge 2 ] || \ - { skip_env "$0: Need two or more remote clients, have $CLIENTCOUNT" && exit 0; } +[ -z "$CLIENTS" ] && skip_env "$TESTSUITE: Need two or more clients" +[ $CLIENTCOUNT -lt 2 ] && + skip_env "$TESTSUITE: Need 2+ clients, have only $CLIENTCOUNT" -# [ "$SLOW" = "no" ] && EXCEPT_SLOW="" MOUNT_2="" @@ -47,7 +48,7 @@ test_3a() { # a half of clients by default increment=${INCREMENT:-$(( CLIENTCOUNT / 2 ))} - machinefile=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines} + machinefile=${MACHINEFILE:-$TMP/$TESTSUITE.machines} local LOG=$TMP/${TESTSUITE}_$tfile local var=${SINGLEMDS}_svc @@ -59,7 +60,7 @@ test_3a() { local IFree=$(inodes_available) [ $IFree -gt $nfiles ] || nfiles=$IFree - local dir=$DIR/$tdir + local dir=$DIR/d0.$TESTNAME mkdir -p $dir chmod 0777 $dir @@ -69,42 +70,46 @@ test_3a() { local num=$increment - while [ $num -le $CLIENTCOUNT ]; do - list=$(comma_list ${nodes[@]:0:$num}) + while [ $num -le $CLIENTCOUNT ]; do + list=$(comma_list ${nodes[@]:0:$num}) - generate_machine_file $list $machinefile || - { error "can not generate machinefile"; exit 1; } + generate_machine_file $list $machinefile || + { error "can not generate machinefile"; exit 1; } - for i in $(seq $iters); do - mdsrate_cleanup $num $machinefile $nfiles $dir 'f%%d' --ignore + for i in $(seq $iters); do + mdsrate_cleanup $num $machinefile $nfiles $dir 'f%%d' \ + --ignore - COMMAND="${MDSRATE} --create --nfiles $nfiles --dir $dir --filefmt 'f%%d'" - mpi_run -np $((num * nthreads)) -machinefile $machinefile ${COMMAND} | tee ${LOG} & + COMMAND="${MDSRATE} --create --nfiles $nfiles --dir + $dir --filefmt 'f%%d'" + mpi_run ${MACHINEFILE_OPTION} $machinefile \ + -np $((num * nthreads)) ${COMMAND} | tee ${LOG}& - pid=$! - echo "pid=$pid" + pid=$! + echo "pid=$pid" - # 2 threads 100000 creates 117 secs - sleep 20 + # 2 threads 100000 creates 117 secs + sleep 20 - log "$i : Starting failover on $SINGLEMDS" - facet_failover $SINGLEMDS - if ! wait_recovery_complete $SINGLEMDS $((TIMEOUT * 10)); then - echo "$SINGLEMDS recovery is not completed!" - kill -9 $pid - exit 7 - fi + log "$i : Starting failover on $SINGLEMDS" + facet_failover $SINGLEMDS + if ! wait_recovery_complete $SINGLEMDS \ + $((TIMEOUT * 10)); then + echo "$SINGLEMDS recovery is not completed!" + kill -9 $pid + exit 7 + fi - duration=$(do_facet $SINGLEMDS lctl get_param -n $procfile | grep recovery_duration) - - res=( "${res[@]}" "$num" ) - res=( "${res[@]}" "$duration" ) - echo "RECOVERY TIME: NFILES=$nfiles number of clients: $num $duration" - wait $pid + duration=$(do_facet $SINGLEMDS lctl get_param -n \ + $procfile | grep recovery_duration) - done - num=$((num + increment)) - done + res=( "${res[@]}" "$num" ) + res=( "${res[@]}" "$duration" ) + echo "RECOVERY TIME: NFILES=$nfiles number of clients: $num $duration" + wait $pid + done + num=$((num + increment)) + done mdsrate_cleanup $num $machinefile $nfiles $dir 'f%%d' --ignore @@ -117,6 +122,6 @@ test_3a() { run_test 3a "recovery time, $CLIENTCOUNT clients" -equals_msg `basename $0`: test complete, cleaning up +complete $SECONDS check_and_cleanup_lustre -[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true +exit_status