Whamcloud - gitweb
b_release_1_4_6-patchless is now using lustre-build from HEAD. Happy hacking.
[fs/lustre-release.git] / lustre / tests / runregression-net.sh
index 337d807..77d6768 100644 (file)
@@ -1,23 +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:-10000000}
+COUNT=${COUNT:-100000}
 COUNT_10=`expr $COUNT / 10`
 COUNT_100=`expr $COUNT / 100`
 COUNT_1000=`expr $COUNT / 1000`
 
 ENDRUN=endrun-`hostname`
 
-ECHONAME="`$OBDCTL device_list 2> /dev/null | awk '/ echo_client / { print $4 }' | tail -1`"
+ECHONAME="`lctl device_list 2> /dev/null | awk '/ echo_client / { print $4 }' | tail -n 1`"
 
 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
@@ -28,28 +30,27 @@ runthreads() {
        case $DO in
        test_getattr)
                RW=
-
+               ;;
        test_brw_write)
                DO=test_brw
                RW=w
                ;;
-
        test_brw_read)
                DO=test_brw
                RW=r
                ;;
        esac
 
-       $OBDCTL --threads $THR v \$$ECHONAME $DO $CNT $RW $V $PGS $OID || exit 1
+       lctl --threads $THR v \$$ECHONAME $DO $CNT $RW $V $PGS $OID || exit 1
 
-       if [ -e endrun ]; then
-               rm endrun
-               echo "exiting because endrun file was found"
-               exit 0
+       if [ -e $ENDRUN ]; then
+               rm $ENDRUN
+               echo "exiting because $ENDRUN file was found"
+               cleanup
        fi
 }
 
-[ -z "$OID" ] && OID=`$OBDCTL --device \\$$ECHONAME create 1 | awk '/is object id/ { print $6 }'`
+[ -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
@@ -62,15 +63,11 @@ for CMD in test_getattr test_brw_write test_brw_read; do
                ;;
        test_brw_write)
                PG=1
-               PGV=16
+               PGV=${PGV:-16}
                ;;
-
        test_brw_read)
                PG=1
-               case $OSTNODE in
-               ba*) PGV= ;; # disabled until the BA OST code is updated
-               *) PGV=16 ;;
-               esac
+               PGV=${PGV:-16}
                ;;
        esac
 
@@ -79,16 +76,13 @@ for CMD in test_getattr test_brw_write test_brw_read; do
        runthreads 1 $CMD 1 1 $PG
        runthreads 1 $CMD 100 1 $PG
 
-       debug_server_off
-       debug_client_off
+       echo 0 > /proc/sys/portals/debug
        runthreads 1 $CMD $COUNT_100 -10 $PG
        [ "$PGV" ] && runthreads 1 $CMD $COUNT_1000 -10 $PGV
 
        runthreads 1 $CMD $COUNT -30 $PG
        [ "$PGV" ] && runthreads 1 $CMD $COUNT_10 -30 $PGV
 
-       runthreads 1 $CMD 100 -10 $PG
-
        runthreads 2 $CMD $COUNT_100 -30 $PG
        [ "$PGV" ] && runthreads 2 $CMD $COUNT_1000 -30 $PGV
 
@@ -102,4 +96,4 @@ for CMD in test_getattr test_brw_write test_brw_read; do
        [ "$PGV" ] && runthreads 100 $CMD $COUNT_1000 -30 $PGV
 done
 
-$OBDCTL --device \$$ECHONAME destroy $OID
+lctl --device \$$ECHONAME destroy $OID