X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Frunregression-net.sh;h=58f33ef87b1d279ea6c5d078bf60be44179b09d3;hb=9b6f9d17a35188f5f4dbfae840164b999a7a78a2;hp=03a2e151fe26d3edb492e1a003830fb2c8981f85;hpb=7c5287b1cd0afbe26c806eea1c7006cfd3d1662b;p=fs%2Flustre-release.git diff --git a/lustre/tests/runregression-net.sh b/lustre/tests/runregression-net.sh index 03a2e15..58f33ef 100644 --- a/lustre/tests/runregression-net.sh +++ b/lustre/tests/runregression-net.sh @@ -1,14 +1,25 @@ #!/bin/sh -export PATH=/sbin:/usr/sbin:$PATH - SRCDIR="`dirname $0`/" -. $SRCDIR/common.sh +export PATH=/sbin:/usr/sbin:$SRCDIR/../utils:$PATH + +COUNT=${COUNT:-100000} +COUNT_10=`expr $COUNT / 10` +COUNT_100=`expr $COUNT / 100` +COUNT_1000=`expr $COUNT / 1000` + +ENDRUN=endrun-`hostname` -setup_opts $@ +ECHONAME="`lctl device_list 2> /dev/null | awk '/ echo_client / { print $4 }' | tail -n 1`" -setup_portals -setup_lustre +if [ -z "$ECHONAME" ]; then + echo "$0: needs an ECHO_CLIENT set up first" 1>&2 + exit 1 +fi +cleanup () { + lctl --device \$$ECHONAME destroy $OID +} + runthreads() { THR=$1 DO=$2 @@ -16,7 +27,7 @@ runthreads() { V=$4 PGS=$5 - case $CMD in + case $DO in test_getattr) RW= ;; @@ -24,43 +35,39 @@ runthreads() { DO=test_brw RW=w ;; - test_brw_read) DO=test_brw RW=r ;; esac - if [ -e endrun ]; then - rm endrun - echo "exiting because of endrun" - exit 0 - fi + lctl --threads $THR v \$$ECHONAME $DO $CNT $RW $V $PGS $OID || exit 1 - $OBDCTL --threads $THR v '$OSCDEV' $DO $CNT $RW $V $PGS $OID || exit 1 + if [ -e $ENDRUN ]; then + rm $ENDRUN + echo "exiting because $ENDRUN file was found" + cleanup + fi } +[ -z "$OID" ] && OID=`lctl --device \\$$ECHONAME create 1 | awk '/is object id/ { print $6 }'` && echo "created object $OID" +[ -z "$OID" ] && echo "error creating object" 1>&2 && exit 1 + # TODO: obdctl needs to check on the progress of each forked thread # (IPC SHM, sockets?) to see if it hangs. for CMD in test_getattr test_brw_write test_brw_read; do - setup_server || exit -1 - setup_client || exit -1 - case $CMD in test_getattr) PG= PGV= - OID=`$OBDCTL --device '$OSCDEV' create 1 | \ - awk '/is object id/ { print $6 }'` ;; test_brw_write) PG=1 - PGV=16 + PGV=${PGV:-16} ;; - test_brw_read) PG=1 - PGV=16 + PGV=${PGV:-16} ;; esac @@ -69,42 +76,24 @@ for CMD in test_getattr test_brw_write test_brw_read; do runthreads 1 $CMD 1 1 $PG runthreads 1 $CMD 100 1 $PG - #cleanup_client || exit -1 - #cleanup_server || exit -1 - - #setup_server || exit -1 - #setup_client || exit -1 - - debug_server_off - debug_client_off - runthreads 1 $CMD 10000 100 $PG - [ "$PGV" ] && runthreads 1 $CMD 1000 100 $PGV - - runthreads 1 $CMD 1000000 -30 $PG - [ "$PGV" ] && runthreads 1 $CMD 100000 -30 $PGV - - debug_server_on - debug_client_on - runthreads 1 $CMD 100 1 $PG - - debug_server_off - debug_client_off - runthreads 2 $CMD 10000 100 $PG - [ "$PGV" ] && runthreads 2 $CMD 1000 100 $PGV + echo 0 > /proc/sys/lnet/debug + runthreads 1 $CMD $COUNT_100 -10 $PG + [ "$PGV" ] && runthreads 1 $CMD $COUNT_1000 -10 $PGV - runthreads 2 $CMD 1000000 -30 $PG - [ "$PGV" ] && runthreads 2 $CMD 100000 -30 $PGV + runthreads 1 $CMD $COUNT -30 $PG + [ "$PGV" ] && runthreads 1 $CMD $COUNT_10 -30 $PGV - runthreads 10 $CMD 10000 1000 $PG - [ "$PGV" ] && runthreads 10 $CMD 1000 1000 $PGV + runthreads 2 $CMD $COUNT_100 -30 $PG + [ "$PGV" ] && runthreads 2 $CMD $COUNT_1000 -30 $PGV - runthreads 100 $CMD 10000 -30 $PG + runthreads 2 $CMD $COUNT -30 $PG + [ "$PGV" ] && runthreads 2 $CMD $COUNT_10 -30 $PGV - [ "$CMD" = "test_brw_read" ] && $OBDCTL --device '$OSCDEV' destroy $OID + runthreads 10 $CMD $COUNT_10 -30 $PG + [ "$PGV" ] && runthreads 10 $CMD $COUNT_100 -30 $PGV - cleanup_client || exit -1 - cleanup_server || exit -1 + runthreads 100 $CMD $COUNT_100 -30 $PG + [ "$PGV" ] && runthreads 100 $CMD $COUNT_1000 -30 $PGV done -cleanup_lustre -cleanup_portals +lctl --device \$$ECHONAME destroy $OID