Whamcloud - gitweb
Like runregression-net.sh, but only bulk I/O, and lots of it. It does
[fs/lustre-release.git] / lustre / tests / runregression-brw.sh
1 #!/bin/sh
2 export PATH=/sbin:/usr/sbin:$PATH
3
4 SRCDIR="`dirname $0`/"
5 . $SRCDIR/common.sh
6
7 runthreads() {
8         THR=$1
9         DO=$2
10         CNT=$3
11         V=$4
12         PGS=$5
13
14         case $DO in
15         test_getattr)
16                 RW=
17                 ;;
18         test_brw_write)
19                 DO=test_brw
20                 RW=w
21                 ;;
22
23         test_brw_read)
24                 DO=test_brw
25                 RW=r
26                 ;;
27         esac
28
29         if [ -e endrun ]; then
30                 rm endrun
31                 echo "exiting because endrun file was found"
32                 exit 0
33         fi
34
35         $OBDCTL --threads $THR v '$OSCDEV' $DO $CNT $RW $V $PGS $OID || exit 1
36 }
37
38 if [  -z "`$OBDCTL device_list | grep osc`" ]; then
39         setup_opts $@
40
41         setup_portals
42         setup_lustre
43
44         setup_server || exit -1
45         setup_client || exit -1
46 fi
47
48 OID=`$OBDCTL --device '$OSCDEV' create 1 | awk '/is object id/ { print $6 }'`
49 [ -z "$OID" ] && echo "error creating object" 1>&2 && exit 1
50
51 # TODO: obdctl needs to check on the progress of each forked thread
52 #       (IPC SHM, sockets?) to see if it hangs.
53 while date; do
54         PG=1
55         PGV=16
56         # We use '--threads 1 X' instead of '--device X' so that
57         # obdctl can monitor the forked thread for progress (TODO).
58         debug_server_off
59         debug_client_off
60         runthreads 1 test_brw_write 10000000 -30 $PG
61         runthreads 1 test_brw_read 10000000 -30 $PG
62
63         [ "$PGV" ] && runthreads 1 test_brw_write 1000000 -30 $PGV
64         [ "$PGV" ] && runthreads 1 test_brw_read 1000000 -30 $PGV
65
66         runthreads 2 test_brw_write 10000000 -30 $PG
67         runthreads 2 test_brw_read 10000000 -30 $PG
68
69         [ "$PGV" ] && runthreads 2 test_brw_write 1000000 -30 $PGV
70         [ "$PGV" ] && runthreads 2 test_brw_read 1000000 -30 $PGV
71
72         runthreads 10 test_brw_write 1000000 -30 $PG
73         runthreads 10 test_brw_read 1000000 -30 $PG
74
75         [ "$PGV" ] && runthreads 10 test_brw_write 100000 -60 $PGV
76         [ "$PGV" ] && runthreads 10 test_brw_read 100000 -60 $PGV
77
78         runthreads 32 test_brw_write 1000000 -30 $PG
79         runthreads 32 test_brw_read 1000000 -30 $PG
80
81         [ "$PGV" ] && runthreads 32 test_brw_write 100000 -60 $PGV
82         [ "$PGV" ] && runthreads 32 test_brw_read 100000 -60 $PGV
83
84         runthreads 64 test_brw_write 1000000 -30 $PG
85         runthreads 64 test_brw_read 1000000 -30 $PG
86
87         [ "$PGV" ] && runthreads 64 test_brw_write 100000 -60 $PGV
88         [ "$PGV" ] && runthreads 64 test_brw_read 100000 -60 $PGV
89
90         runthreads 100 test_brw_write 100000 -60 $PG
91         runthreads 100 test_brw_read 100000 -60 $PG
92
93         [ "$PGV" ] && runthreads 100 test_brw_write 100000 -60 $PGV
94         [ "$PGV" ] && runthreads 100 test_brw_read 100000 -60 $PGV
95 done
96
97 $OBDCTL --device '$OSCDEV' destroy $OID
98
99 cleanup_client || exit -1
100 cleanup_server || exit -1
101 cleanup_lustre
102 cleanup_portals