Whamcloud - gitweb
New improved runregression script.
authoradilger <adilger>
Wed, 4 Sep 2002 07:19:32 +0000 (07:19 +0000)
committeradilger <adilger>
Wed, 4 Sep 2002 07:19:32 +0000 (07:19 +0000)
It creates an OST object at the start of the test and does the write test
before the read test.  This should allow it to run against a real OST.
It also does vector I/O testing for BRW read/write tests.

lustre/tests/runregression-net.sh

index 44a98ed..03a2e15 100644 (file)
@@ -9,24 +9,65 @@ setup_opts $@
 setup_portals
 setup_lustre
 
-# 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_read test_brw_write; do
+runthreads() {
+       THR=$1
+       DO=$2
+       CNT=$3
+       V=$4
+       PGS=$5
+
        case $CMD in
-       test_brw_read)  CMD=test_brw; RW=r ;;
-       test_brw_write) CMD=test_brw; RW=w ;;
-       *)              RW= ;;
+       test_getattr)
+               RW=
+               ;;
+       test_brw_write)
+               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
+
+       $OBDCTL --threads $THR v '$OSCDEV' $DO $CNT $RW $V $PGS $OID || 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
 
-       OSC_DEVNO=`$OBDCTL name2dev OSCDEV`
+       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
+               ;;
+
+       test_brw_read)
+               PG=1
+               PGV=16
+               ;;
+       esac
 
        # We use '--threads 1 X' instead of '--device X' so that
-       # obdctl can modnitor the forked thread for progress (TODO).
-       $OBDCTL --threads 1 v $OSC_DEVNO $CMD 1 $RW v || exit -1
-       $OBDCTL --threads 1 v $OSC_DEVNO $CMD 100 $RW v || exit -1
+       # obdctl can monitor the forked thread for progress (TODO).
+       runthreads 1 $CMD 1 1 $PG
+       runthreads 1 $CMD 100 1 $PG
 
        #cleanup_client || exit -1
        #cleanup_server || exit -1
@@ -36,20 +77,30 @@ for CMD in test_getattr test_brw_read test_brw_write; do
 
        debug_server_off
        debug_client_off
-       $OBDCTL --threads 1 v $OSC_DEVNO $CMD 10000 $RW 100 || exit -1
-       $OBDCTL --threads 1 v $OSC_DEVNO $CMD 1000000 $RW -10 || exit -1
+       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
-       $OBDCTL --threads 2 v $OSC_DEVNO $CMD 100 $RW v || exit -1
+       runthreads 1 $CMD 100 1 $PG
 
        debug_server_off
        debug_client_off
-       $OBDCTL --threads 2 v $OSC_DEVNO $CMD 10000 $RW 100 || exit -1
-       $OBDCTL --threads 2 v $OSC_DEVNO $CMD 1000000 $RW -30 || exit -1
+       runthreads 2 $CMD 10000 100 $PG
+       [ "$PGV" ] && runthreads 2 $CMD 1000 100 $PGV
+
+       runthreads 2 $CMD 1000000 -30 $PG
+       [ "$PGV" ] && runthreads 2 $CMD 100000 -30 $PGV
+
+       runthreads 10 $CMD 10000 1000 $PG
+       [ "$PGV" ] && runthreads 10 $CMD 1000 1000 $PGV
 
-       $OBDCTL --threads 10 v $OSC_DEVNO $CMD 10000 $RW 1000 || exit -1
-       $OBDCTL --threads 100 v $OSC_DEVNO $CMD 10000 $RW -30 || exit -1
+       runthreads 100 $CMD 10000 -30 $PG
+
+       [ "$CMD" = "test_brw_read" ] && $OBDCTL --device '$OSCDEV' destroy $OID
 
        cleanup_client || exit -1
        cleanup_server || exit -1
@@ -57,5 +108,3 @@ done
 
 cleanup_lustre
 cleanup_portals
-
-