Further work on a generic benchmarking framework.
[xfstests-dev.git] / common.config
1 ##/bin/sh
2
3 #
4 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
5
6 # This program is free software; you can redistribute it and/or modify it
7 # under the terms of version 2 of the GNU General Public License as
8 # published by the Free Software Foundation.
9
10 # This program is distributed in the hope that it would be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
14 # Further, this software is distributed without any warranty that it is
15 # free of the rightful claim of any third person regarding infringement
16 # or the like.  Any license provided herein, whether implied or
17 # otherwise, applies only to this software file.  Patent licenses, if
18 # any, provided herein do not apply to combinations of this program with
19 # other software, or any other product whatsoever.
20
21 # You should have received a copy of the GNU General Public License along
22 # with this program; if not, write the Free Software Foundation, Inc., 59
23 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
24
25 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
26 # Mountain View, CA  94043, or:
27
28 # http://www.sgi.com 
29
30 # For further information regarding this notice, see: 
31
32 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
33 #
34
35 #
36 # setup and check for config parameters, and in particular
37 #
38 # TEST_DIR              - scratch test directory that is in an already
39 #                         mounted XFS file system, needs to be be world
40 #                         writeable
41 # TEST_DEV              - device for file system containing TEST_DIR
42 # SCRATCH_DEV           - device you can make a scratch file system on
43 # SCRATCH_MNT           - mount point for scratch file system
44
45 # and optionally:
46 # SCRATCH_LOGDEV        - scratch log device for external log testing
47 # SCRATCH_RTDEV         - scratch rt dev (only for testing cmds currently)
48 # TAPE_DEV              - the tape device for the xfsdump tests
49 # RMT_TAPE_DEV          - the remote tape device for the xfsdump tests
50 # RMT_IRIXTAPE_DEV      - the IRIX remote tape device for the xfsdump tests
51 # RMT_TAPE_USER         - remote user for tape device
52 #
53
54 #
55 # - This script is shared by the stress test system and the auto-qa
56 #   system (includes both regression test and benchmark components).
57 # - TEST_DEV & TEST_DIR must be assigned.
58 # - this script shouldn't make any assertions about filesystem
59 #   validity or mountedness.
60 #
61
62 HOST=`hostname -s`
63 MODULAR=0               # using XFS as a module or not
64 BOOT="/boot"            # install target for kernels
65 export EXTRA=${EXTRA:=-xfs-qa}
66
67 # general parameters (mainly for auto-qa)
68 SOAK_PROC=3             # -p option to fsstress
69 SOAK_STRESS=10000       # -n option to fsstress
70 SOAK_PASSES=-1          # count of repetitions of fsstress (while soaking)
71 BENCH_PASSES=5          # count of repetitions of benchmarks (want averages)
72 EMAIL=root@localhost    # where auto-qa will send its status messages
73 export MKFS_OPTIONS=${MKFS_OPTIONS:=-bsize=4096}
74 export MOUNT_OPTIONS=${MOUNT_OPTIONS:=-ologbufs=2}
75 export MALLOCLIB=${MALLOCLIB:=/usr/lib/libefence.a}
76
77 case "$HOST"
78 in
79     bruce)
80         MODULAR=0
81         EMAIL="nathans@larry"
82         TEST_DEV=/dev/sda10
83         TEST_DIR=/mnt/xfs1
84         SCRATCH_DEV=/dev/sda9
85         SCRATCH_MNT=/mnt/xfs0
86         SCRATCH_LOGDEV=/dev/sda11
87         TAPE_DEV=/dev/st0
88         RMT_TAPE_DEV=bruce:/dev/st0
89         RMT_IRIXTAPE_DEV=snort:/dev/tape
90         RMT_TAPE_USER=guest
91         ;;
92     sherman)
93         TEST_DEV=/dev/sda10
94         TEST_DIR=/mnt/xfs1
95         SCRATCH_DEV=/dev/sda9
96         SCRATCH_MNT=/mnt/xfs0
97         ;;
98     sagan)
99         MODULAR=1
100         EMAIL="tes@larry"
101         TEST_DEV=/dev/sda6
102         TEST_DIR=/mnt/xfs0
103         SCRATCH_DEV=/dev/sda7
104         SCRATCH_MNT=/mnt/xfs1
105         TAPE_DEV=/dev/st0
106         RMT_TAPE_DEV=sagan:/dev/st0
107         RMT_IRIXTAPE_DEV=snort:/dev/tape
108         RMT_TAPE_USER=guest
109         ;;
110     frodo)
111         MODULAR=0
112         EMAIL="nathans@larry"
113         TEST_DEV=/dev/hda6
114         TEST_DIR=/mnt/test
115         SCRATCH_DEV=/dev/hda7
116         SCRATCH_MNT=/mnt/scratch
117         ;;
118     troppo)
119         MODULAR=0
120         EMAIL="kaos@larry"
121         TEST_DEV=/dev/hdb13
122         TEST_DIR=/mnt/test
123         SCRATCH_DEV=/dev/hdb14
124         SCRATCH_MNT=/mnt/scratch
125         SCRATCH_LOGDEV=/dev/hdb15
126         ;;
127     lord)
128         TEST_DIR=/xfs
129         TEST_DEV=/dev/sda5
130         SCRATCH_DEV=/dev/hda7
131         SCRATCH_LOGDEV=/dev/sda6
132         SCRATCH_MNT=/xfs1
133         ;;
134     burst)
135         TEST_DIR=/xfs
136         TEST_DEV=/dev/hda3
137         SCRATCH_DEV=/dev/hda7
138         SCRATCH_MNT=/scratch
139         ;;
140     lumpy)
141         TEST_DEV=/dev/sdc5
142         TEST_DIR=/mnt/scratch_0
143         SCRATCH_DEV=/dev/sdc7
144         SCRATCH_MNT=/mnt/scratch_2
145         ;;
146     bongo)
147         TEST_DEV=/dev/hda8
148         TEST_DIR=/xfs1
149         SCRATCH_DEV=/dev/hda9
150         SCRATCH_MNT=/xfs2
151         SCRATCH_LOGDEV=/dev/hda10
152         SCRATCH_RTDEV=/dev/hda11
153         ;;
154     surly)
155         TEST_DEV=/dev/hda9
156         TEST_DIR=/mnt/xfs1
157         SCRATCH_DEV=/dev/hda8
158         SCRATCH_MNT=/mnt/xfs0
159         SCRATCH_LOGDEV=/dev/hda10
160         TAPE_DEV=/dev/st0
161         RMT_TAPE_DEV=fuzzy:/dev/st0
162         RMT_IRIXTAPE_DEV=blub:/dev/tape
163         RMT_TAPE_USER=guest
164         ;;
165     permit)
166         TEST_DEV=/dev/sdc1
167         TEST_DIR=/mnt/xfs0
168         SCRATCH_DEV=/dev/sdd1
169         SCRATCH_MNT=/mnt/xfs1
170         ;;
171     indra)
172         TEST_DEV=/dev/sdb1
173         TEST_DIR=/mnt/xfs0
174         SCRATCH_DEV=/dev/sdb2
175         SCRATCH_MNT=/mnt/xfs1
176         ;;
177     usermode)
178         TEST_DEV=/dev/ubd/1
179         TEST_DIR=/mnt/test
180         SCRATCH_DEV=/dev/ubd/2
181         SCRATCH_MNT=/mnt/scratch
182         SCRATCH_RTDEV=/dev/ubd/3
183         SCRATCH_LOGDEV=/dev/ubd/4
184         ;;
185     lite)
186         TEST_DEV=/dev/sda1
187         TEST_DIR=/mnt/sda1
188         SCRATCH_DEV=/dev/sda2
189         SCRATCH_MNT=/mnt/sda2
190         SCRATCH_LOGDEV=/dev/sda3
191         ;;
192     dmfnt2)
193         TEST_DEV=/dev/sda6
194         TEST_DIR=/mnt/test
195         SCRATCH_DEV=/dev/sdc6
196         SCRATCH_MNT=/mnt/scratch
197         TAPE_DEV=/dev/st0
198         RMT_TAPE_DEV=longhorn:/dev/tape
199 #       RMT_IRIXTAPE_DEV=longhorn:/dev/tape
200         RMT_TAPE_USER=guest
201         ;;
202     *)
203         echo "common.config: Error: need to define parameters for host $HOST"
204         exit 1
205         ;;
206 esac
207
208 if [ ! -b "$TEST_DEV" ]
209 then
210     echo "common.config: Error: \$TEST_DEV ($TEST_DEV) is not a block device"
211     exit 1
212 fi
213
214 if [ ! -d "$TEST_DIR" ]
215 then
216     echo "common.config: Error: \$TEST_DIR ($TEST_DIR) is not a directory"
217     exit 1
218 fi
219
220 if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" ]
221 then
222     echo "common.config: Error: \$SCRATCH_DEV ($SCRATCH_DEV) is not a block device"
223     exit 1
224 fi
225
226 if [ ! -z "$SCRATCH_DEV" -a ! -d "$SCRATCH_MNT" ]
227 then
228     echo "common.config: Error: \$SCRATCH_MNT ($SCRATCH_MNT) is not a directory"
229     exit 1
230 fi
231
232 _readlink()
233 {
234     if [ $# -ne 1 ]
235     then
236         echo "Usage: _readlink filename" 1>&2
237         exit 1
238     fi
239
240     perl -e "\$in=\"$1\";" -e '
241         $lnk = readlink($in);
242         if ($lnk =~ m!^/.*!) {
243           print "$lnk\n";
244         }
245         else {
246           chomp($dir = `dirname $in`);
247           print "$dir/$lnk\n";
248         }'
249 }
250
251 # if devfs is running expand the full /dev/.. pathname - this is what will be
252 # returned by utilities such as mount
253 [ -L "$TEST_DEV" ] && TEST_DEV=`_readlink $TEST_DEV`
254 [ -L "$SCRATCH_DEV" ] && SCRATCH_DEV=`_readlink $SCRATCH_DEV`
255 [ -L "$SCRATCH_LOGDEV" ] && SCRATCH_LOGDEV=`_readlink $SCRATCH_LOGDEV`
256 [ -L "$SCRATCH_RTDEV" ] && SCRATCH_RTDEV=`_readlink $SCRATCH_LOGDEV`
257
258 # make sure this script returns success
259 /bin/true