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