Add an fsx test, allow fsx to preallocate file space on -x
[xfstests-dev.git] / common.config
1 ##/bin/sh
2
3 #
4 # Copyright (c) 2000-2003 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
48 # TEST_LOGDEV           - test log device for external log testing
49 # TEST_RTDEV            - test rt dev
50 # TAPE_DEV              - the tape device for the xfsdump tests
51 # RMT_TAPE_DEV          - the remote tape device for the xfsdump tests
52 # RMT_IRIXTAPE_DEV      - the IRIX remote tape device for the xfsdump tests
53 # RMT_TAPE_USER         - remote user for tape device
54 #
55
56 #
57 # - This script is shared by the stress test system and the auto-qa
58 #   system (includes both regression test and benchmark components).
59 # - TEST_DEV & TEST_DIR must be assigned.
60 # - this script shouldn't make any assertions about filesystem
61 #   validity or mountedness.
62 #
63
64 HOST=`hostname -s`
65 MODULAR=0               # using XFS as a module or not
66 BOOT="/boot"            # install target for kernels
67 export EXTRA=${EXTRA:=-xfs-qa}
68
69 # general parameters (mainly for auto-qa)
70 SOAK_PROC=3             # -p option to fsstress
71 SOAK_STRESS=10000       # -n option to fsstress
72 SOAK_PASSES=-1          # count of repetitions of fsstress (while soaking)
73 EMAIL=root@localhost    # where auto-qa will send its status messages
74 export MKFS_OPTIONS=${MKFS_OPTIONS:=-bsize=4096}
75 export MOUNT_OPTIONS=${MOUNT_OPTIONS:=-ologbufs=2}
76 export CHECK_OPTIONS=${CHECK_OPTIONS:="-g auto"}
77 export BENCH_PASSES=${BENCH_PASSES:=5}
78
79 #export DEBUG=${DEBUG:=...} # arbitrary CFLAGS really.
80 export MALLOCLIB=${MALLOCLIB:=/usr/lib/libefence.a}
81 export LOCAL_CONFIGURE_OPTIONS=${LOCAL_CONFIGURE_OPTIONS:=--enable-readline=yes}
82
83 case "$HOST"
84 in
85     bruce)
86         MODULAR=0
87         EMAIL="nathans@larry"
88         SCRATCH_MNT=/mnt/xfs0
89         SCRATCH_DEV=/dev/sdb5
90         SCRATCH_LOGDEV=/dev/sda11
91         TEST_DIR=/mnt/xfs1
92         TEST_DEV=/dev/sdc3
93         TEST_LOGDEV=/dev/sda9
94         TAPE_DEV=/dev/st0
95         RMT_TAPE_DEV=bruce:/dev/st0
96         RMT_IRIXTAPE_DEV=snort:/dev/tape
97         RMT_TAPE_USER=guest
98         ;;
99     sherman)
100         TEST_DEV=/dev/sda10
101         TEST_DIR=/mnt/xfs1
102         SCRATCH_DEV=/dev/sda9
103         SCRATCH_MNT=/mnt/xfs0
104         ;;
105     flutz)
106         MODULAR=0
107         EMAIL="nathans@larry"
108         TEST_DEV=/dev/sda5
109         TEST_LOGDEV=/dev/sda9
110         TEST_DIR=/xfsqa1
111         SCRATCH_DEV=/dev/sda6
112         SCRATCH_LOGDEV=/dev/sda7
113         SCRATCH_MNT=/xfsqa2
114         TAPE_DEV=/dev/st0
115         RMT_TAPE_DEV=bruce:/dev/st0
116         RMT_IRIXTAPE_DEV=snort:/dev/tape
117         RMT_TAPE_USER=guest
118         ;;
119     frodo)
120         MODULAR=0
121         EMAIL="nathans@larry"
122         TEST_DEV=/dev/hda6
123         TEST_DIR=/mnt/test
124         SCRATCH_DEV=/dev/hda7
125         SCRATCH_MNT=/mnt/scratch
126         SCRATCH_LOGDEV=/dev/hda9
127         ;;
128     goldfish)
129         MODULAR=0
130         TEST_DEV=/dev/hdc1
131         TEST_DIR=/mnt/xfs0
132         SCRATCH_DEV=/dev/hdc2
133         SCRATCH_MNT=/mnt/xfs1
134         SCRATCH_LOGDEV=/dev/hdc3
135         ;;
136     lord)
137         TEST_DIR=/xfs
138         TEST_DEV=/dev/sda5
139         SCRATCH_DEV=/dev/hda7
140         SCRATCH_LOGDEV=/dev/sda6
141         SCRATCH_MNT=/xfs1
142         ;;
143     burst)
144         TEST_DIR=/xfs
145         TEST_DEV=/dev/hda3
146         SCRATCH_DEV=/dev/hda7
147         SCRATCH_MNT=/scratch
148         ;;
149     lumpy)
150         TEST_DEV=/dev/sdc5
151         TEST_DIR=/mnt/scratch_0
152         SCRATCH_DEV=/dev/sdc7
153         SCRATCH_MNT=/mnt/scratch_2
154         ;;
155     bongo)
156         TEST_DEV=/dev/hda8
157         TEST_DIR=/xfs1
158         SCRATCH_DEV=/dev/hda9
159         SCRATCH_MNT=/xfs2
160         SCRATCH_LOGDEV=/dev/hda10
161         SCRATCH_RTDEV=/dev/hda11
162         ;;
163     surly)
164         TEST_DEV=/dev/hda9
165         TEST_DIR=/mnt/xfs1
166         SCRATCH_DEV=/dev/hda8
167         SCRATCH_MNT=/mnt/xfs0
168         SCRATCH_LOGDEV=/dev/hda10
169         TAPE_DEV=/dev/st0
170         RMT_TAPE_DEV=fuzzy:/dev/st0
171         RMT_IRIXTAPE_DEV=blub:/dev/tape
172         RMT_TAPE_USER=guest
173         ;;
174     permit)
175         TEST_DEV=/dev/sdc1
176         TEST_DIR=/mnt/xfs0
177         SCRATCH_DEV=/dev/sdd1
178         SCRATCH_MNT=/mnt/xfs1
179         ;;
180     indra)
181         TEST_DEV=/dev/sdb1
182         TEST_DIR=/mnt/xfs0
183         SCRATCH_DEV=/dev/sdb2
184         SCRATCH_MNT=/mnt/xfs1
185         ;;
186     usermode)
187         TEST_DEV=/dev/ubd/1
188         TEST_DIR=/mnt/test
189         SCRATCH_DEV=/dev/ubd/2
190         SCRATCH_MNT=/mnt/scratch
191         SCRATCH_RTDEV=/dev/ubd/3
192         SCRATCH_LOGDEV=/dev/ubd/4
193         ;;
194     lite)
195         TEST_DEV=/dev/sda1
196         TEST_DIR=/mnt/sda1
197         SCRATCH_DEV=/dev/sda2
198         SCRATCH_MNT=/mnt/sda2
199         SCRATCH_LOGDEV=/dev/sda3
200         ;;
201     dmfnt2)
202         TEST_DEV=/dev/sda6
203         TEST_DIR=/mnt/test
204         SCRATCH_DEV=/dev/sdc6
205         SCRATCH_MNT=/mnt/scratch
206         TAPE_DEV=/dev/st0
207         RMT_TAPE_DEV=longhorn:/dev/tape
208 #       RMT_IRIXTAPE_DEV=longhorn:/dev/tape
209         RMT_TAPE_USER=guest
210         ;;
211     lab343)
212         MODULAR=0
213         EMAIL="hch@sgi.com"
214         TEST_DEV=/dev/sdb1
215         SCRATCH_DEV=/dev/sdb2
216         SCRATCH_LOGDEV=/dev/sdb5
217         SCRATCH_RTDEV=/dev/sdb6
218         TEST_DIR=/qa/test
219         SCRATCH_MNT=/qa/scratch
220         ;;
221     *)
222         echo "common.config: Error: need to define parameters for host $HOST"
223         exit 1
224         ;;
225 esac
226
227 if [ ! -b "$TEST_DEV" ]
228 then
229     echo "common.config: Error: \$TEST_DEV ($TEST_DEV) is not a block device"
230     exit 1
231 fi
232
233 if [ ! -d "$TEST_DIR" ]
234 then
235     echo "common.config: Error: \$TEST_DIR ($TEST_DIR) is not a directory"
236     exit 1
237 fi
238
239 if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" ]
240 then
241     echo "common.config: Error: \$SCRATCH_DEV ($SCRATCH_DEV) is not a block device"
242     exit 1
243 fi
244
245 if [ ! -z "$SCRATCH_DEV" -a ! -d "$SCRATCH_MNT" ]
246 then
247     echo "common.config: Error: \$SCRATCH_MNT ($SCRATCH_MNT) is not a directory"
248     exit 1
249 fi
250
251 _readlink()
252 {
253     if [ $# -ne 1 ]
254     then
255         echo "Usage: _readlink filename" 1>&2
256         exit 1
257     fi
258
259     perl -e "\$in=\"$1\";" -e '
260         $lnk = readlink($in);
261         if ($lnk =~ m!^/.*!) {
262           print "$lnk\n";
263         }
264         else {
265           chomp($dir = `dirname $in`);
266           print "$dir/$lnk\n";
267         }'
268 }
269
270 # if devfs is running expand the full /dev/.. pathname - this is what will be
271 # returned by utilities such as mount
272 [ -L "$TEST_DEV" ] && TEST_DEV=`_readlink $TEST_DEV`
273 [ -L "$SCRATCH_DEV" ] && SCRATCH_DEV=`_readlink $SCRATCH_DEV`
274 [ -L "$SCRATCH_LOGDEV" ] && SCRATCH_LOGDEV=`_readlink $SCRATCH_LOGDEV`
275 [ -L "$SCRATCH_RTDEV" ] && SCRATCH_RTDEV=`_readlink $SCRATCH_LOGDEV`
276
277 # make sure this script returns success
278 /bin/true