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