Allow for use of an external log device in benchmarks.
[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 EMAIL=root@localhost    # where auto-qa will send its status messages
72 export MKFS_OPTIONS=${MKFS_OPTIONS:=-bsize=4096}
73 export MOUNT_OPTIONS=${MOUNT_OPTIONS:=-ologbufs=2}
74 export MALLOCLIB=${MALLOCLIB:=/usr/lib/libefence.a}
75 export BENCH_PASSES=${BENCH_PASSES:=5}
76
77 case "$HOST"
78 in
79     bruce)
80         MODULAR=0
81         EMAIL="nathans@larry"
82         SCRATCH_MNT=/mnt/xfs0
83         SCRATCH_DEV=/dev/sdb5
84         SCRATCH_RTDEV=/dev/sda9
85         SCRATCH_LOGDEV=/dev/sda11
86         TEST_DIR=/mnt/xfs1
87         TEST_DEV=/dev/sda10
88         TAPE_DEV=/dev/st0
89         RMT_TAPE_DEV=bruce:/dev/st0
90         RMT_IRIXTAPE_DEV=snort:/dev/tape
91         RMT_TAPE_USER=guest
92         ;;
93     sherman)
94         TEST_DEV=/dev/sda10
95         TEST_DIR=/mnt/xfs1
96         SCRATCH_DEV=/dev/sda9
97         SCRATCH_MNT=/mnt/xfs0
98         ;;
99     sagan)
100         MODULAR=1
101         EMAIL="tes@larry"
102         TEST_DEV=/dev/sda6
103         TEST_DIR=/mnt/xfs0
104         SCRATCH_DEV=/dev/sda7
105         SCRATCH_MNT=/mnt/xfs1
106         TAPE_DEV=/dev/st0
107         RMT_TAPE_DEV=sagan:/dev/st0
108         RMT_IRIXTAPE_DEV=snort:/dev/tape
109         RMT_TAPE_USER=guest
110         ;;
111     frodo)
112         MODULAR=0
113         EMAIL="nathans@larry"
114         TEST_DEV=/dev/hda6
115         TEST_DIR=/mnt/test
116         SCRATCH_DEV=/dev/hda7
117         SCRATCH_MNT=/mnt/scratch
118         SCRATCH_LOGDEV=/dev/hda9
119         ;;
120     goldfish)
121         MODULAR=0
122         TEST_DEV=/dev/hdc1
123         TEST_DIR=/mnt/xfs0
124         SCRATCH_DEV=/dev/hdc2
125         SCRATCH_MNT=/mnt/xfs1
126         SCRATCH_LOGDEV=/dev/hdc3
127         ;;
128     lord)
129         TEST_DIR=/xfs
130         TEST_DEV=/dev/sda5
131         SCRATCH_DEV=/dev/hda7
132         SCRATCH_LOGDEV=/dev/sda6
133         SCRATCH_MNT=/xfs1
134         ;;
135     burst)
136         TEST_DIR=/xfs
137         TEST_DEV=/dev/hda3
138         SCRATCH_DEV=/dev/hda7
139         SCRATCH_MNT=/scratch
140         ;;
141     lumpy)
142         TEST_DEV=/dev/sdc5
143         TEST_DIR=/mnt/scratch_0
144         SCRATCH_DEV=/dev/sdc7
145         SCRATCH_MNT=/mnt/scratch_2
146         ;;
147     bongo)
148         TEST_DEV=/dev/hda8
149         TEST_DIR=/xfs1
150         SCRATCH_DEV=/dev/hda9
151         SCRATCH_MNT=/xfs2
152         SCRATCH_LOGDEV=/dev/hda10
153         SCRATCH_RTDEV=/dev/hda11
154         ;;
155     surly)
156         TEST_DEV=/dev/hda9
157         TEST_DIR=/mnt/xfs1
158         SCRATCH_DEV=/dev/hda8
159         SCRATCH_MNT=/mnt/xfs0
160         SCRATCH_LOGDEV=/dev/hda10
161         TAPE_DEV=/dev/st0
162         RMT_TAPE_DEV=fuzzy:/dev/st0
163         RMT_IRIXTAPE_DEV=blub:/dev/tape
164         RMT_TAPE_USER=guest
165         ;;
166     permit)
167         TEST_DEV=/dev/sdc1
168         TEST_DIR=/mnt/xfs0
169         SCRATCH_DEV=/dev/sdd1
170         SCRATCH_MNT=/mnt/xfs1
171         ;;
172     indra)
173         TEST_DEV=/dev/sdb1
174         TEST_DIR=/mnt/xfs0
175         SCRATCH_DEV=/dev/sdb2
176         SCRATCH_MNT=/mnt/xfs1
177         ;;
178     usermode)
179         TEST_DEV=/dev/ubd/1
180         TEST_DIR=/mnt/test
181         SCRATCH_DEV=/dev/ubd/2
182         SCRATCH_MNT=/mnt/scratch
183         SCRATCH_RTDEV=/dev/ubd/3
184         SCRATCH_LOGDEV=/dev/ubd/4
185         ;;
186     lite)
187         TEST_DEV=/dev/sda1
188         TEST_DIR=/mnt/sda1
189         SCRATCH_DEV=/dev/sda2
190         SCRATCH_MNT=/mnt/sda2
191         SCRATCH_LOGDEV=/dev/sda3
192         ;;
193     dmfnt2)
194         TEST_DEV=/dev/sda6
195         TEST_DIR=/mnt/test
196         SCRATCH_DEV=/dev/sdc6
197         SCRATCH_MNT=/mnt/scratch
198         TAPE_DEV=/dev/st0
199         RMT_TAPE_DEV=longhorn:/dev/tape
200 #       RMT_IRIXTAPE_DEV=longhorn:/dev/tape
201         RMT_TAPE_USER=guest
202         ;;
203     lab343)
204         MODULAR=0
205         EMAIL="hch@sgi.com"
206         TEST_DEV=/dev/sdb1
207         SCRATCH_DEV=/dev/sdb2
208         SCRATCH_LOGDEV=/dev/sdb5
209         SCRATCH_RTDEV=/dev/sdb6
210         TEST_DIR=/qa/test
211         SCRATCH_MNT=/qa/scratch
212         ;;
213     *)
214         echo "common.config: Error: need to define parameters for host $HOST"
215         exit 1
216         ;;
217 esac
218
219 if [ ! -b "$TEST_DEV" ]
220 then
221     echo "common.config: Error: \$TEST_DEV ($TEST_DEV) is not a block device"
222     exit 1
223 fi
224
225 if [ ! -d "$TEST_DIR" ]
226 then
227     echo "common.config: Error: \$TEST_DIR ($TEST_DIR) is not a directory"
228     exit 1
229 fi
230
231 if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" ]
232 then
233     echo "common.config: Error: \$SCRATCH_DEV ($SCRATCH_DEV) is not a block device"
234     exit 1
235 fi
236
237 if [ ! -z "$SCRATCH_DEV" -a ! -d "$SCRATCH_MNT" ]
238 then
239     echo "common.config: Error: \$SCRATCH_MNT ($SCRATCH_MNT) is not a directory"
240     exit 1
241 fi
242
243 _readlink()
244 {
245     if [ $# -ne 1 ]
246     then
247         echo "Usage: _readlink filename" 1>&2
248         exit 1
249     fi
250
251     perl -e "\$in=\"$1\";" -e '
252         $lnk = readlink($in);
253         if ($lnk =~ m!^/.*!) {
254           print "$lnk\n";
255         }
256         else {
257           chomp($dir = `dirname $in`);
258           print "$dir/$lnk\n";
259         }'
260 }
261
262 # if devfs is running expand the full /dev/.. pathname - this is what will be
263 # returned by utilities such as mount
264 [ -L "$TEST_DEV" ] && TEST_DEV=`_readlink $TEST_DEV`
265 [ -L "$SCRATCH_DEV" ] && SCRATCH_DEV=`_readlink $SCRATCH_DEV`
266 [ -L "$SCRATCH_LOGDEV" ] && SCRATCH_LOGDEV=`_readlink $SCRATCH_LOGDEV`
267 [ -L "$SCRATCH_RTDEV" ] && SCRATCH_RTDEV=`_readlink $SCRATCH_LOGDEV`
268
269 # make sure this script returns success
270 /bin/true