Added qa machine porky to common.confing.
[xfstests-dev.git] / common.config
1 ##/bin/sh
2 #
3 # Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
4 #
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.
8 #
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.
12 #
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.
19 #
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.
23 #
24 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
25 # Mountain View, CA  94043, or:
26 #
27 # http://www.sgi.com
28 #
29 # For further information regarding this notice, see:
30 #
31 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
32 #
33
34 #
35 # setup and check for config parameters, and in particular
36 #
37 # TEST_DIR              - scratch test directory that is in an already
38 #                         mounted XFS file system, needs to be be world
39 #                         writeable
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
43 #
44 # and optionally:
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
53 #
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.
61 #
62
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
67 PATH=".:$PATH"
68
69 HOST=`hostname -s`
70 HOSTOS=`uname -s`
71 [ "$HOSTOS" = "IRIX64" ] && HOSTOS="IRIX"
72
73 MODULAR=0               # using XFS as a module or not
74 BOOT="/boot"            # install target for kernels
75 export EXTRA=${EXTRA:=xfs-qa}
76
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}
86
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}
90
91 # $1 = prog to look for, $2* = default pathnames if not found in $PATH
92 set_prog_path()
93 {
94     p=`which $1 2> /dev/null`
95     if [ -n "$p" -a -x "$p" ]
96     then
97         echo $p
98         return 0
99     fi
100     p=$1
101
102     shift
103     for f
104     do
105         if [ -x $f ]
106         then
107             echo $f
108             return 0
109         fi
110     done
111
112     echo ""
113     return 1
114 }
115
116 _fatal()
117 {
118     echo "$*"
119     status=1
120     exit 1
121 }
122
123 export MKFS_PROG="`set_prog_path mkfs`"
124 [ "$MKFS_PROG" = "" ] && _fatal "mkfs not found"
125
126 export AWK_PROG="`set_prog_path awk`"
127 [ "$AWK_PROG" = "" ] && _fatal "awk not found"
128
129 export MOUNT_PROG="`set_prog_path mount`"
130 [ "$MOUNT_PROG" = "" ] && _fatal "mount not found"
131
132 export UMOUNT_PROG="`set_prog_path umount`"
133 [ "$UMOUNT_PROG" = "" ] && _fatal "umount not found"
134
135 export NSLOOKUP_PROG="`set_prog_path nslookup`"
136 [ "$NSLOOKUP_PROG" = "" ] && _fatal "nslookup not found"
137
138 export PERL_PROG="`set_prog_path perl`"
139 [ "$PERL_PROG" = "" ] && _fatal "perl not found"
140
141 export SED_PROG="`set_prog_path sed`"
142 [ "$SED_PROG" = "" ] && _fatal "sed not found"
143
144 export PS_ALL_FLAGS="-ef"
145
146 export DF_PROG="`set_prog_path df`"
147 [ "$DF_PROG" = "" ] && _fatal "df not found"
148 [ "$HOSTOS" = "Linux" ] && export DF_PROG="$DF_PROG -T"
149
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`"
154 export XFS_GROWFS_PROG=`set_prog_path xfs_growfs`
155 export XFS_IO_PROG="`set_prog_path xfs_io`"
156
157 case "$HOSTOS" in
158     IRIX*)
159            export MKFS_XFS_PROG="`set_prog_path mkfs_xfs`"
160            export MKFS_UDF_PROG="`set_prog_path mkfs_udf`"
161            export XFS_FSR_PROG="`set_prog_path /usr/etc/fsr_xfs`"
162            export MKFS_NFS_PROG="false"
163            ;;
164     Linux)
165            export MKFS_XFS_PROG="`set_prog_path mkfs.xfs`"
166            export MKFS_UDF_PROG="`set_prog_path mkudffs`"
167            export XFS_FSR_PROG="`set_prog_path xfs_fsr`"
168            export MKFS_NFS_PROG="false"
169            ;;
170 esac
171
172 known_hosts()
173 {
174         case "$HOST"
175         in
176             sheila)
177                 MODULAR=1
178                 EMAIL="nathans@larry"
179                 SCRATCH_MNT=/mnt/scratch
180                 SCRATCH_DEV=/dev/hdb1
181                 TEST_DIR=/mnt/test
182                 TEST_DEV=/dev/hdb2
183                 TEST_LOGDEV=/dev/hdb3
184                 SCRATCH_LOGDEV=/dev/hdb5
185                 #SCRATCH_RTDEV=/dev/hdb6
186                 RMT_TAPE_DEV=bruce:/dev/st0
187                 RMT_IRIXTAPE_DEV=snort:/dev/tape
188                 RMT_TAPE_USER=guest
189                 ;;
190             bruce)
191                 MODULAR=0
192                 EMAIL="nathans@larry"
193                 SCRATCH_MNT=/mnt/xfs0
194                 SCRATCH_DEV=/dev/sdb5
195                 #SCRATCH_RTDEV=/dev/sdc1
196                 #SCRATCH_RTDEV=/dev/md0
197                 SCRATCH_LOGDEV=/dev/sda11
198                 TEST_DIR=/mnt/xfs1
199                 TEST_DEV=/dev/sdc3
200                 #TEST_RTDEV=/dev/sdb6
201                 TEST_LOGDEV=/dev/sda9
202                 TAPE_DEV=/dev/st0
203                 RMT_TAPE_DEV=bruce:/dev/st0
204                 RMT_IRIXTAPE_DEV=snort:/dev/tape
205                 RMT_TAPE_USER=guest
206                 ;;
207             frodo)
208                 MODULAR=0
209                 EMAIL="nathans@larry"
210                 TEST_DEV=/dev/hda6
211                 TEST_DIR=/mnt/test
212                 SCRATCH_DEV=/dev/hda7
213                 SCRATCH_MNT=/mnt/scratch
214                 SCRATCH_LOGDEV=/dev/hda9
215                 ;;
216             goldfish)
217                 MODULAR=0
218                 TEST_DEV=/dev/hdc1
219                 TEST_DIR=/mnt/xfs0
220                 SCRATCH_DEV=/dev/hdc2
221                 SCRATCH_MNT=/mnt/xfs1
222                 SCRATCH_LOGDEV=/dev/hdc3
223                 ;;
224             burst)
225                 TEST_DIR=/xfs
226                 TEST_DEV=/dev/hda3
227                 SCRATCH_DEV=/dev/hda7
228                 SCRATCH_MNT=/scratch
229                 ;;
230             lumpy)
231                 TEST_DEV=/dev/sdc5
232                 TEST_DIR=/mnt/scratch_0
233                 SCRATCH_DEV=/dev/sdc7
234                 SCRATCH_MNT=/mnt/scratch_2
235                 ;;
236             bongo)
237                 TEST_DEV=/dev/hda8
238                 TEST_DIR=/xfs1
239                 SCRATCH_DEV=/dev/hda9
240                 SCRATCH_MNT=/xfs2
241                 SCRATCH_LOGDEV=/dev/hda10
242                 SCRATCH_RTDEV=/dev/hda11
243                 ;;
244             surly)
245                 TEST_DEV=/dev/hda9
246                 TEST_DIR=/mnt/xfs1
247                 SCRATCH_DEV=/dev/hda8
248                 SCRATCH_MNT=/mnt/xfs0
249                 SCRATCH_LOGDEV=/dev/hda10
250                 TAPE_DEV=/dev/st0
251                 RMT_TAPE_DEV=fuzzy:/dev/st0
252                 RMT_IRIXTAPE_DEV=blub:/dev/tape
253                 RMT_TAPE_USER=guest
254                 ;;
255             permit)
256                 TEST_DEV=/dev/sdc1
257                 TEST_DIR=/mnt/xfs0
258                 SCRATCH_DEV=/dev/sdd1
259                 SCRATCH_MNT=/mnt/xfs1
260                 ;;
261             indra)
262                 TEST_DEV=/dev/sdb1
263                 TEST_DIR=/mnt/xfs0
264                 SCRATCH_DEV=/dev/sdb2
265                 SCRATCH_MNT=/mnt/xfs1
266                 ;;
267             usermode)
268                 TEST_DEV=/dev/ubd/1
269                 TEST_DIR=/mnt/test
270                 SCRATCH_DEV=/dev/ubd/2
271                 SCRATCH_MNT=/mnt/scratch
272                 SCRATCH_RTDEV=/dev/ubd/3
273                 SCRATCH_LOGDEV=/dev/ubd/4
274                 ;;
275             lite)
276                 TEST_DEV=/dev/sda1
277                 TEST_DIR=/mnt/sda1
278                 SCRATCH_DEV=/dev/sda2
279                 SCRATCH_MNT=/mnt/sda2
280                 SCRATCH_LOGDEV=/dev/sda3
281                 SCRATCH_RTDEV=/dev/sda4
282                 ;;
283             dmfnt2)
284                 TEST_DEV=/dev/sda6
285                 TEST_DIR=/mnt/test
286                 SCRATCH_DEV=/dev/sdc6
287                 SCRATCH_MNT=/mnt/scratch
288                 TAPE_DEV=/dev/st0
289                 RMT_TAPE_DEV=longhorn:/dev/tape
290                 # RMT_IRIXTAPE_DEV=longhorn:/dev/tape
291                 RMT_TAPE_USER=guest
292                 ;;
293             lab343)
294                 MODULAR=0
295                 EMAIL="hch@sgi.com"
296                 TEST_DEV=/dev/sdb1
297                 SCRATCH_DEV=/dev/sdb2
298                 SCRATCH_LOGDEV=/dev/sdb5
299                 SCRATCH_RTDEV=/dev/sdb6
300                 TEST_DIR=/qa/test
301                 SCRATCH_MNT=/qa/scratch
302                 ;;
303             icy)
304                 MODULAR=0
305                 EMAIL="ajones@sgi.com"
306                 TEST_DIR=/mnt/test
307                 TEST_DEV=/dev/sdb1
308                 TEST_LOGDEV=/dev/sdb3
309                 SCRATCH_MNT=/mnt/scratch
310                 SCRATCH_DEV=/dev/sdb2
311                 SCRATCH_LOGDEV=/dev/sdb5
312                 SCRATCH_RTDEV=/dev/sdb6
313                 TAPE_DEV=/dev/st0
314                 RMT_IRIXTAPE_DEV=snort:/dev/tape
315                 RMT_TAPE_DEV=icy:/dev/st0
316                 RMT_TAPE_USER=guest
317                 ;;
318             dribble)
319                 MODULAR=0
320                 EMAIL="ajones@sgi.com"
321                 TEST_DIR=/mnt/test
322                 TEST_DEV=/dev/dsk/dks0d2s0
323                 #TEST_LOGDEV=
324                 SCRATCH_MNT=/mnt/scratch
325                 #SCRATCH_DEV=emu:/mnt/scratch
326                 SCRATCH_DEV=/dev/dsk/dks0d2s1
327                 #SCRATCH_LOGDEV=
328                 #SCRATCH_RTDEV=
329                 TAPE_DEV=/dev/tape
330                 RMT_TAPE_DEV=icy:/dev/st0
331                 RMT_TAPE_USER=guest
332                 RMT_IRIXTAPE_DEV=snort:/dev/tape
333                 ;;
334             emu)
335                 MODULAR=0
336                 EMAIL="ajones@sgi.com"
337                 TEST_DIR=/mnt/test
338                 TEST_DEV=/dev/sdb1
339                 SCRATCH_MNT=/mnt/scratch
340                 SCRATCH_DEV=/dev/sdb2
341                 ;;
342             inferno)
343                 MODULAR=1
344                 EMAIL="ajones@sgi.com"
345                 TEST_DIR=/mnt/test
346                 TEST_DEV=/dev/sdb1
347                 TEST_LOGDEV=/dev/sdb3
348                 SCRATCH_MNT=/mnt/scratch
349                 SCRATCH_DEV=/dev/sdb2
350                 SCRATCH_LOGDEV=/dev/sdb4
351                 #SCRATCH_RTDEV=/dev/sdb5
352                 TAPE_DEV=/dev/st0
353                 RMT_IRIXTAPE_DEV=snort:/dev/tape
354                 RMT_TAPE_DEV=icy:/dev/st0
355                 RMT_TAPE_USER=guest
356                 ;;
357             rooster)
358                 MODULAR=1
359                 EMAIL="ajones@sgi.com"
360                 TEST_DIR=/mnt/test
361                 TEST_DEV=/dev/sdb1
362                 SCRATCH_MNT=/mnt/scratch
363                 SCRATCH_DEV=/dev/sdb2
364                 TAPE_DEV=/dev/st0
365                 RMT_IRIXTAPE_DEV=snort:/dev/tape
366                 RMT_TAPE_DEV=icy:/dev/st0
367                 RMT_TAPE_USER=guest
368                 ;;
369             rosella)
370                 MODULAR=1
371                 EMAIL="ajones@sgi.com"
372                 TEST_DIR=/mnt/test
373                 TEST_DEV=/dev/sdb1
374                 SCRATCH_MNT=/mnt/scratch
375                 SCRATCH_DEV=/dev/sdb3
376                 TAPE_DEV=/dev/st0
377                 RMT_IRIXTAPE_DEV=snort:/dev/tape
378                 RMT_TAPE_DEV=icy:/dev/st0
379                 RMT_TAPE_USER=guest
380                 ;;
381             crackle)
382                 #irix-crackle
383                 TEST_DIR=/mnt/xfs
384                 SCRATCH_MNT=/mnt/xfs2
385                 TEST_DEV=/dev/dsk/dks0d1s3
386                 SCRATCH_DEV=/dev/dsk/dks0d1s4
387                 ;;
388             tinkle)
389                 #irix-patchbox-tinkle
390                 TEST_DEV=/dev/dsk/dks0d2s0
391                 TEST_DIR=/mnt/xfs_test
392                 SCRATCH_DEV=/dev/dsk/dks0d2s1
393                 SCRATCH_MNT=/mnt/xfs_scratch
394                 ;;
395             cocky)
396                 MODULAR=1
397                 EMAIL="ajones@sgi.com"
398                 TEST_DIR=/mnt/test
399                 TEST_DEV=/dev/sdb1
400                 TEST_LOGDEV=/dev/sdb3
401                 SCRATCH_MNT=/mnt/scratch
402                 SCRATCH_DEV=/dev/sdb2
403                 SCRATCH_LOGDEV=/dev/sdb4
404                 #SCRATCH_RTDEV=/dev/sdb5
405                 TAPE_DEV=/dev/st0
406                 RMT_IRIXTAPE_DEV=snort:/dev/tape
407                 RMT_TAPE_DEV=icy:/dev/st0
408                 RMT_TAPE_USER=guest
409                 ;;
410             porky)
411                 MODULAR=1
412                 EMAIL="ajones@sgi.com"
413                 TEST_DIR=/mnt/test
414                 TEST_DEV=/dev/sdb2
415                 TEST_LOGDEV=/dev/sdb5
416                 SCRATCH_MNT=/mnt/scratch
417                 SCRATCH_DEV=/dev/sdb3
418                 SCRATCH_LOGDEV=/dev/sdb6
419                 #SCRATCH_RTDEV=/dev/sdb7
420                 TAPE_DEV=/dev/st0
421                 RMT_IRIXTAPE_DEV=snort:/dev/tape
422                 RMT_TAPE_DEV=icy:/dev/st0
423                 RMT_TAPE_USER=guest
424                 ;;
425             *)
426                 echo "Error: need to define parameters for host $HOST"
427                 exit 1
428                 ;;
429         esac
430 }
431
432 if [ -f "$HOST_OPTIONS" ]; then
433     . "$HOST_OPTIONS"
434 else
435     known_hosts
436 fi
437
438 echo $TEST_DEV | grep -q ":" > /dev/null 2>&1
439 if [ ! -b "$TEST_DEV" -a "$?" != "0" ]
440 then
441     echo "common.config: Error: \$TEST_DEV ($TEST_DEV) is not a block device or a NFS filesystem"
442     exit 1
443 fi
444
445 if [ ! -d "$TEST_DIR" ]
446 then
447     echo "common.config: Error: \$TEST_DIR ($TEST_DIR) is not a directory"
448     exit 1
449 fi
450
451 echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
452 if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" -a "$?" != "0" ]
453 then
454     echo "common.config: Error: \$SCRATCH_DEV ($SCRATCH_DEV) is not a block device or a NFS filesystem"
455     exit 1
456 fi
457
458 if [ ! -z "$SCRATCH_MNT" -a ! -d "$SCRATCH_MNT" ]
459 then
460     echo "common.config: Error: \$SCRATCH_MNT ($SCRATCH_MNT) is not a directory"
461     exit 1
462 fi
463
464 _readlink()
465 {
466     if [ $# -ne 1 ]
467     then
468         echo "Usage: _readlink filename" 1>&2
469         exit 1
470     fi
471
472     perl -e "\$in=\"$1\";" -e '
473         $lnk = readlink($in);
474         if ($lnk =~ m!^/.*!) {
475           print "$lnk\n";
476         }
477         else {
478           chomp($dir = `dirname $in`);
479           print "$dir/$lnk\n";
480         }'
481 }
482
483 # if devfs is running expand the full /dev/.. pathname - this is what will be
484 # returned by utilities such as mount
485 [ -L "$TEST_DEV" ] && TEST_DEV=`_readlink $TEST_DEV`
486 [ -L "$SCRATCH_DEV" ] && SCRATCH_DEV=`_readlink $SCRATCH_DEV`
487 [ -L "$SCRATCH_LOGDEV" ] && SCRATCH_LOGDEV=`_readlink $SCRATCH_LOGDEV`
488 [ -L "$SCRATCH_RTDEV" ] && SCRATCH_RTDEV=`_readlink $SCRATCH_LOGDEV`
489
490 # make sure this script returns success
491 /bin/true