3 # Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of version 2 of the GNU General Public License as
7 # published by the Free Software Foundation.
9 # This program is distributed in the hope that it would be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 # Further, this software is distributed without any warranty that it is
14 # free of the rightful claim of any third person regarding infringement
15 # or the like. Any license provided herein, whether implied or
16 # otherwise, applies only to this software file. Patent licenses, if
17 # any, provided herein do not apply to combinations of this program with
18 # other software, or any other product whatsoever.
20 # You should have received a copy of the GNU General Public License along
21 # with this program; if not, write the Free Software Foundation, Inc., 59
22 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
24 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
25 # Mountain View, CA 94043, or:
29 # For further information regarding this notice, see:
31 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
35 # setup and check for config parameters, and in particular
37 # TEST_DIR - scratch test directory that is in an already
38 # mounted XFS file system, needs to be be world
40 # TEST_DEV - device for file system containing TEST_DIR
41 # SCRATCH_DEV - device you can make a scratch file system on
42 # SCRATCH_MNT - mount point for scratch file system
45 # SCRATCH_LOGDEV - scratch log device for external log testing
46 # SCRATCH_RTDEV - scratch rt dev
47 # TEST_LOGDEV - test log device for external log testing
48 # TEST_RTDEV - test rt dev
49 # TAPE_DEV - the tape device for the xfsdump tests
50 # RMT_TAPE_DEV - the remote tape device for the xfsdump tests
51 # RMT_IRIXTAPE_DEV - the IRIX remote tape device for the xfsdump tests
52 # RMT_TAPE_USER - remote user for tape device
54 # - These can be added to known_hosts() below or a separate local
55 # configuration file can be used (using the HOST_OPTIONS variable).
56 # - This script is shared by the stress test system and the auto-qa
57 # system (includes both regression test and benchmark components).
58 # - TEST_DEV & TEST_DIR must be assigned.
59 # - this script shouldn't make any assertions about filesystem
60 # validity or mountedness.
63 # Warning: don't put freeware before /usr/bsd on IRIX coz you'll
64 # get the wrong hostname and set your system name to -s :)
65 [ -d /usr/bsd ] && PATH=$PATH:/usr/bsd
66 [ -d /usr/freeware/bin ] && PATH=$PATH:/usr/freeware/bin
71 [ "$HOSTOS" = "IRIX64" ] && HOSTOS="IRIX"
73 MODULAR=0 # using XFS as a module or not
74 BOOT="/boot" # install target for kernels
75 export EXTRA=${EXTRA:=xfs-qa}
77 # general parameters (mainly for auto-qa)
78 SOAK_PROC=3 # -p option to fsstress
79 SOAK_STRESS=10000 # -n option to fsstress
80 SOAK_PASSES=-1 # count of repetitions of fsstress (while soaking)
81 EMAIL=root@localhost # where auto-qa will send its status messages
82 export HOST_OPTIONS=${HOST_OPTIONS:=local.config}
83 export CHECK_OPTIONS=${CHECK_OPTIONS:="-g auto"}
84 export BENCH_PASSES=${BENCH_PASSES:=5}
85 export XFS_MKFS_OPTIONS=${XFS_MKFS_OPTIONS:=-bsize=4096}
87 #export DEBUG=${DEBUG:=...} # arbitrary CFLAGS really.
88 export MALLOCLIB=${MALLOCLIB:=/usr/lib/libefence.a}
89 export LOCAL_CONFIGURE_OPTIONS=${LOCAL_CONFIGURE_OPTIONS:=--enable-readline=yes}
91 # $1 = prog to look for, $2* = default pathnames if not found in $PATH
94 p=`which $1 2> /dev/null`
95 if [ -n "$p" -a -x "$p" ]
123 export MKFS_PROG="`set_prog_path mkfs`"
124 [ "$MKFS_PROG" = "" ] && _fatal "mkfs not found"
126 export AWK_PROG="`set_prog_path awk`"
127 [ "$AWK_PROG" = "" ] && _fatal "awk not found"
129 export MOUNT_PROG="`set_prog_path mount`"
130 [ "$MOUNT_PROG" = "" ] && _fatal "mount not found"
132 export UMOUNT_PROG="`set_prog_path umount`"
133 [ "$UMOUNT_PROG" = "" ] && _fatal "umount not found"
135 export NSLOOKUP_PROG="`set_prog_path nslookup`"
136 [ "$NSLOOKUP_PROG" = "" ] && _fatal "nslookup not found"
138 export PERL_PROG="`set_prog_path perl`"
139 [ "$PERL_PROG" = "" ] && _fatal "perl not found"
141 export SED_PROG="`set_prog_path sed`"
142 [ "$SED_PROG" = "" ] && _fatal "sed not found"
144 export PS_ALL_FLAGS="-ef"
146 export DF_PROG="`set_prog_path df`"
147 [ "$DF_PROG" = "" ] && _fatal "df not found"
148 [ "$HOSTOS" = "Linux" ] && export DF_PROG="$DF_PROG -T"
150 export XFS_LOGPRINT_PROG="`set_prog_path xfs_logprint`"
151 export XFS_REPAIR_PROG="`set_prog_path xfs_repair`"
152 export XFS_CHECK_PROG="`set_prog_path xfs_check`"
153 export XFS_DB_PROG="`set_prog_path xfs_db`"
157 export MKFS_XFS_PROG="`set_prog_path mkfs_xfs`"
158 export MKFS_UDF_PROG="`set_prog_path mkfs_udf`"
159 export XFS_FSR_PROG="`set_prog_path /usr/etc/fsr_xfs`"
160 export MKFS_NFS_PROG="false"
163 export MKFS_XFS_PROG="`set_prog_path mkfs.xfs`"
164 export MKFS_UDF_PROG="`set_prog_path mkudffs`"
165 export XFS_FSR_PROG="`set_prog_path xfs_fsr`"
166 export MKFS_NFS_PROG="false"
176 EMAIL="nathans@larry"
177 SCRATCH_MNT=/mnt/xfs0
178 SCRATCH_DEV=/dev/hda5
181 RMT_TAPE_DEV=bruce:/dev/st0
182 RMT_IRIXTAPE_DEV=snort:/dev/tape
187 EMAIL="nathans@larry"
188 SCRATCH_MNT=/mnt/xfs0
189 SCRATCH_DEV=/dev/sdb5
190 #SCRATCH_RTDEV=/dev/sdc1
191 SCRATCH_LOGDEV=/dev/sda11
194 #TEST_RTDEV=/dev/sdb6
195 TEST_LOGDEV=/dev/sda9
197 RMT_TAPE_DEV=bruce:/dev/st0
198 RMT_IRIXTAPE_DEV=snort:/dev/tape
203 EMAIL="nathans@larry"
206 SCRATCH_DEV=/dev/hda7
207 SCRATCH_MNT=/mnt/scratch
208 SCRATCH_LOGDEV=/dev/hda9
214 SCRATCH_DEV=/dev/hdc2
215 SCRATCH_MNT=/mnt/xfs1
216 SCRATCH_LOGDEV=/dev/hdc3
221 SCRATCH_DEV=/dev/hda7
226 TEST_DIR=/mnt/scratch_0
227 SCRATCH_DEV=/dev/sdc7
228 SCRATCH_MNT=/mnt/scratch_2
233 SCRATCH_DEV=/dev/hda9
235 SCRATCH_LOGDEV=/dev/hda10
236 SCRATCH_RTDEV=/dev/hda11
241 SCRATCH_DEV=/dev/hda8
242 SCRATCH_MNT=/mnt/xfs0
243 SCRATCH_LOGDEV=/dev/hda10
245 RMT_TAPE_DEV=fuzzy:/dev/st0
246 RMT_IRIXTAPE_DEV=blub:/dev/tape
252 SCRATCH_DEV=/dev/sdd1
253 SCRATCH_MNT=/mnt/xfs1
258 SCRATCH_DEV=/dev/sdb2
259 SCRATCH_MNT=/mnt/xfs1
264 SCRATCH_DEV=/dev/ubd/2
265 SCRATCH_MNT=/mnt/scratch
266 SCRATCH_RTDEV=/dev/ubd/3
267 SCRATCH_LOGDEV=/dev/ubd/4
272 SCRATCH_DEV=/dev/sda2
273 SCRATCH_MNT=/mnt/sda2
274 SCRATCH_LOGDEV=/dev/sda3
275 SCRATCH_RTDEV=/dev/sda4
280 SCRATCH_DEV=/dev/sdc6
281 SCRATCH_MNT=/mnt/scratch
283 RMT_TAPE_DEV=longhorn:/dev/tape
284 # RMT_IRIXTAPE_DEV=longhorn:/dev/tape
291 SCRATCH_DEV=/dev/sdb2
292 SCRATCH_LOGDEV=/dev/sdb5
293 SCRATCH_RTDEV=/dev/sdb6
295 SCRATCH_MNT=/qa/scratch
299 EMAIL="ajones@sgi.com"
302 #TEST_LOGDEV=/dev/sda9
303 #TEST_RTDEV=/dev/sda10
304 SCRATCH_MNT=/mnt/scratch
305 #SCRATCH_DEV=emu:/mnt/scratch
306 SCRATCH_DEV=/dev/sda5
307 SCRATCH_LOGDEV=/dev/sda8
308 SCRATCH_RTDEV=/dev/sda7
310 RMT_IRIXTAPE_DEV=snort:/dev/tape
311 RMT_TAPE_DEV=icy:/dev/st0
316 EMAIL="ajones@sgi.com"
318 TEST_DEV=/dev/dsk/dks0d2s0
320 SCRATCH_MNT=/mnt/scratch
321 #SCRATCH_DEV=emu:/mnt/scratch
322 SCRATCH_DEV=/dev/dsk/dks0d2s1
326 RMT_TAPE_DEV=icy:/dev/st0
328 RMT_IRIXTAPE_DEV=snort:/dev/tape
332 EMAIL="ajones@sgi.com"
335 SCRATCH_MNT=/mnt/scratch
336 SCRATCH_DEV=/dev/sdb2
340 EMAIL="ajones@sgi.com"
343 SCRATCH_MNT=/mnt/scratch
344 SCRATCH_DEV=/dev/sdb2
346 RMT_IRIXTAPE_DEV=snort:/dev/tape
347 RMT_TAPE_DEV=icy:/dev/st0
352 echo "Error: need to define parameters for host $HOST"
358 if [ -f "$HOST_OPTIONS" ]; then
364 echo $TEST_DEV | grep -q ":" > /dev/null 2>&1
365 if [ ! -b "$TEST_DEV" -a "$?" != "0" ]
367 echo "common.config: Error: \$TEST_DEV ($TEST_DEV) is not a block device or a NFS filesystem"
371 if [ ! -d "$TEST_DIR" ]
373 echo "common.config: Error: \$TEST_DIR ($TEST_DIR) is not a directory"
377 echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
378 if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" -a "$?" != "0" ]
380 echo "common.config: Error: \$SCRATCH_DEV ($SCRATCH_DEV) is not a block device or a NFS filesystem"
384 if [ ! -z "$SCRATCH_MNT" -a ! -d "$SCRATCH_MNT" ]
386 echo "common.config: Error: \$SCRATCH_MNT ($SCRATCH_MNT) is not a directory"
394 echo "Usage: _readlink filename" 1>&2
398 perl -e "\$in=\"$1\";" -e '
399 $lnk = readlink($in);
400 if ($lnk =~ m!^/.*!) {
404 chomp($dir = `dirname $in`);
409 # if devfs is running expand the full /dev/.. pathname - this is what will be
410 # returned by utilities such as mount
411 [ -L "$TEST_DEV" ] && TEST_DEV=`_readlink $TEST_DEV`
412 [ -L "$SCRATCH_DEV" ] && SCRATCH_DEV=`_readlink $SCRATCH_DEV`
413 [ -L "$SCRATCH_LOGDEV" ] && SCRATCH_LOGDEV=`_readlink $SCRATCH_LOGDEV`
414 [ -L "$SCRATCH_RTDEV" ] && SCRATCH_RTDEV=`_readlink $SCRATCH_LOGDEV`
416 # make sure this script returns success