Added cxfsaltix5 to list of known hosts
[xfstests-dev.git] / common.config
1 ##/bin/sh
2 #
3 # Copyright (c) 2000-2003,2006 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # setup and check for config parameters, and in particular
6 #
7 # TEST_DIR              - scratch test directory that is in an already
8 #                         mounted XFS file system, needs to be be world
9 #                         writeable
10 # TEST_DEV              - device for file system containing TEST_DIR
11 # SCRATCH_DEV           - device you can make a scratch file system on
12 # SCRATCH_MNT           - mount point for scratch file system
13 #
14 # and optionally:
15 # SCRATCH_LOGDEV        - scratch log device for external log testing
16 # SCRATCH_RTDEV         - scratch rt dev
17 # TEST_LOGDEV           - test log device for external log testing
18 # TEST_RTDEV            - test rt dev
19 # TAPE_DEV              - the tape device for the xfsdump tests
20 # RMT_TAPE_DEV          - the remote tape device for the xfsdump tests
21 # RMT_IRIXTAPE_DEV      - the IRIX remote tape device for the xfsdump tests
22 # RMT_TAPE_USER         - remote user for tape device
23 #
24 # - These can be added to known_hosts() below or a separate local
25 #   configuration file can be used (using the HOST_OPTIONS variable).
26 # - This script is shared by the stress test system and the auto-qa
27 #   system (includes both regression test and benchmark components).
28 # - TEST_DEV & TEST_DIR must be assigned.
29 # - this script shouldn't make any assertions about filesystem
30 #   validity or mountedness.
31 #
32
33 # Warning: don't put freeware before /usr/bsd on IRIX coz you'll
34 #          get the wrong hostname and set your system name to -s  :)
35 [ -d /usr/bsd ] && PATH=$PATH:/usr/bsd
36 [ -d /usr/freeware/bin ] && PATH=$PATH:/usr/freeware/bin
37 PATH=".:$PATH"
38
39 HOST=`hostname -s`
40 HOSTOS=`uname -s`
41 [ "$HOSTOS" = "IRIX64" ] && HOSTOS="IRIX"
42
43 MODULAR=0               # using XFS as a module or not
44 BOOT="/boot"            # install target for kernels
45 export EXTRA=${EXTRA:=xfs-qa}
46
47 # general parameters (mainly for auto-qa)
48 SOAK_PROC=3             # -p option to fsstress
49 SOAK_STRESS=10000       # -n option to fsstress
50 SOAK_PASSES=-1          # count of repetitions of fsstress (while soaking)
51 EMAIL=root@localhost    # where auto-qa will send its status messages
52 export HOST_OPTIONS=${HOST_OPTIONS:=local.config}
53 export CHECK_OPTIONS=${CHECK_OPTIONS:="-g auto"}
54 export BENCH_PASSES=${BENCH_PASSES:=5}
55 export XFS_MKFS_OPTIONS=${XFS_MKFS_OPTIONS:=-bsize=4096}
56
57 export PWD=`pwd`
58 #export DEBUG=${DEBUG:=...} # arbitrary CFLAGS really.
59 export MALLOCLIB=${MALLOCLIB:=/usr/lib/libefence.a}
60 export LOCAL_CONFIGURE_OPTIONS=${LOCAL_CONFIGURE_OPTIONS:=--enable-readline=yes}
61
62 # $1 = prog to look for, $2* = default pathnames if not found in $PATH
63 set_prog_path()
64 {
65     p=`which $1 2> /dev/null`
66     if [ -n "$p" -a -x "$p" ]
67     then
68         echo $p
69         return 0
70     fi
71     p=$1
72
73     shift
74     for f
75     do
76         if [ -x $f ]
77         then
78             echo $f
79             return 0
80         fi
81     done
82
83     echo ""
84     return 1
85 }
86
87 _fatal()
88 {
89     echo "$*"
90     status=1
91     exit 1
92 }
93
94 export MKFS_PROG="`set_prog_path mkfs`"
95 [ "$MKFS_PROG" = "" ] && _fatal "mkfs not found"
96
97 export MOUNT_PROG="`set_prog_path mount`"
98 [ "$MOUNT_PROG" = "" ] && _fatal "mount not found"
99
100 export UMOUNT_PROG="`set_prog_path umount`"
101 [ "$UMOUNT_PROG" = "" ] && _fatal "umount not found"
102
103 export FSSTRESS_PROG="`set_prog_path fsstress $PWD/ltp/fsstress`"
104 [ "$FSSTRESS_PROG" = "" ] && _fatal "fsstress not found"
105
106 export NSLOOKUP_PROG="`set_prog_path nslookup`"
107 [ "$NSLOOKUP_PROG" = "" ] && _fatal "nslookup not found"
108
109 export PERL_PROG="`set_prog_path perl`"
110 [ "$PERL_PROG" = "" ] && _fatal "perl not found"
111
112 export AWK_PROG="`set_prog_path awk`"
113 [ "$AWK_PROG" = "" ] && _fatal "awk not found"
114
115 export SED_PROG="`set_prog_path sed`"
116 [ "$SED_PROG" = "" ] && _fatal "sed not found"
117
118 export PS_ALL_FLAGS="-ef"
119
120 export DF_PROG="`set_prog_path df`"
121 [ "$DF_PROG" = "" ] && _fatal "df not found"
122 [ "$HOSTOS" = "Linux" ] && export DF_PROG="$DF_PROG -T"
123
124 export XFS_LOGPRINT_PROG="`set_prog_path xfs_logprint`"
125 export XFS_REPAIR_PROG="`set_prog_path xfs_repair`"
126 export XFS_CHECK_PROG="`set_prog_path xfs_check`"
127 export XFS_DB_PROG="`set_prog_path xfs_db`"
128 export XFS_GROWFS_PROG=`set_prog_path xfs_growfs`
129 export XFS_IO_PROG="`set_prog_path xfs_io`"
130 export XFS_PARALLEL_REPAIR_PROG="`set_prog_path xfs_prepair`"
131 export XFS_PARALLEL_REPAIR64_PROG="`set_prog_path xfs_prepair64`"
132
133 case "$HOSTOS" in
134     IRIX*)
135            export MKFS_XFS_PROG="`set_prog_path mkfs_xfs`"
136            export MKFS_UDF_PROG="`set_prog_path mkfs_udf`"
137            export XFS_FSR_PROG="`set_prog_path /usr/etc/fsr_xfs`"
138            export MKFS_NFS_PROG="false"
139            ;;
140     Linux)
141            export MKFS_XFS_PROG="`set_prog_path mkfs.xfs`"
142            export MKFS_UDF_PROG="`set_prog_path mkudffs`"
143            export XFS_FSR_PROG="`set_prog_path xfs_fsr`"
144            export MKFS_NFS_PROG="false"
145            ;;
146 esac
147
148 known_hosts()
149 {
150         case "$HOST"
151         in
152             sheila)
153                 #dedicated qa machine (has some values already set)
154                 [ -z "$MODULAR" ] && MODULAR=1
155                 EMAIL="nathans@larry"
156                 [ -z "$SCRATCH_MNT" ] && SCRATCH_MNT=/mnt/scratch
157                 [ -z "$SCRATCH_DEV" ] && SCRATCH_DEV=/dev/hdb1
158                 [ -z "$TEST_DIR" ] && TEST_DIR=/mnt/test
159                 [ -z "$TEST_DEV" ] && TEST_DEV=/dev/hdb2
160                 [ -z "$TEST_LOGDEV" ] && TEST_LOGDEV=/dev/hdb3
161                 [ -z "$SCRATCH_LOGDEV" ] && SCRATCH_LOGDEV=/dev/hdb5
162                 ;;
163             break)
164                 MODULAR=1
165                 EMAIL="nathans@larry"
166                 SCRATCH_MNT=/mnt/scratch
167                 #SCRATCH_DEV=/dev/sda6
168                 SCRATCH_DEV=budgie:/mnt/scratch
169                 TEST_DIR=/mnt/test
170                 #TEST_DEV=/dev/sda5
171                 TEST_DEV=budgie:/mnt/test
172                 ;;
173             bruce)
174                 MODULAR=0
175                 EMAIL="nathans@larry"
176                 SCRATCH_MNT=/mnt/scratch
177                 SCRATCH_DEV=/dev/sdb5
178                 SCRATCH_RTDEV=/dev/sdc1
179                 SCRATCH_LOGDEV=/dev/ram0
180                 TEST_DIR=/mnt/test
181                 TEST_DEV=/dev/sdc3
182                 TEST_RTDEV=/dev/sdb6
183                 TEST_LOGDEV=/dev/ram1
184                 #TAPE_DEV=/dev/st0
185                 #RMT_TAPE_DEV=bruce:/dev/st0
186                 #RMT_IRIXTAPE_DEV=snort:/dev/tape
187                 #RMT_TAPE_USER=guest
188                 ;;
189             frodo)
190                 MODULAR=0
191                 EMAIL="nathans@larry"
192                 TEST_DEV=/dev/hda6
193                 TEST_DIR=/mnt/test
194                 SCRATCH_DEV=/dev/hda7
195                 SCRATCH_MNT=/mnt/scratch
196                 SCRATCH_LOGDEV=/dev/hda9
197                 ;;
198             goldfish)
199                 MODULAR=0
200                 TEST_DEV=/dev/hdc1
201                 TEST_DIR=/mnt/xfs0
202                 SCRATCH_DEV=/dev/hdc2
203                 SCRATCH_MNT=/mnt/xfs1
204                 SCRATCH_LOGDEV=/dev/hdc3
205                 ;;
206             burst)
207                 TEST_DIR=/xfs
208                 TEST_DEV=/dev/hda3
209                 SCRATCH_DEV=/dev/hda7
210                 SCRATCH_MNT=/scratch
211                 ;;
212             lumpy)
213                 TEST_DEV=/dev/sdc5
214                 TEST_DIR=/mnt/scratch_0
215                 SCRATCH_DEV=/dev/sdc7
216                 SCRATCH_MNT=/mnt/scratch_2
217                 ;;
218             bongo)
219                 TEST_DEV=/dev/hda8
220                 TEST_DIR=/xfs1
221                 SCRATCH_DEV=/dev/hda9
222                 SCRATCH_MNT=/xfs2
223                 SCRATCH_LOGDEV=/dev/hda10
224                 SCRATCH_RTDEV=/dev/hda11
225                 ;;
226             surly)
227                 TEST_DEV=/dev/hda9
228                 TEST_DIR=/mnt/xfs1
229                 SCRATCH_DEV=/dev/hda8
230                 SCRATCH_MNT=/mnt/xfs0
231                 SCRATCH_LOGDEV=/dev/hda10
232                 TAPE_DEV=/dev/st0
233                 RMT_TAPE_DEV=fuzzy:/dev/st0
234                 RMT_IRIXTAPE_DEV=blub:/dev/tape
235                 RMT_TAPE_USER=guest
236                 ;;
237             permit)
238                 TEST_DEV=/dev/sdc1
239                 TEST_DIR=/mnt/xfs0
240                 SCRATCH_DEV=/dev/sdd1
241                 SCRATCH_MNT=/mnt/xfs1
242                 ;;
243             indra)
244                 TEST_DEV=/dev/sdb1
245                 TEST_DIR=/mnt/xfs0
246                 SCRATCH_DEV=/dev/sdb2
247                 SCRATCH_MNT=/mnt/xfs1
248                 ;;
249             usermode)
250                 TEST_DEV=/dev/ubd/1
251                 TEST_DIR=/mnt/test
252                 SCRATCH_DEV=/dev/ubd/2
253                 SCRATCH_MNT=/mnt/scratch
254                 SCRATCH_RTDEV=/dev/ubd/3
255                 SCRATCH_LOGDEV=/dev/ubd/4
256                 ;;
257             lite)
258                 TEST_DEV=/dev/sda1
259                 TEST_DIR=/mnt/sda1
260                 SCRATCH_DEV=/dev/sda2
261                 SCRATCH_MNT=/mnt/sda2
262                 SCRATCH_LOGDEV=/dev/sda3
263                 SCRATCH_RTDEV=/dev/sda4
264                 ;;
265             dmfnt2)
266                 TEST_DEV=/dev/sda6
267                 TEST_DIR=/mnt/test
268                 SCRATCH_DEV=/dev/sdc6
269                 SCRATCH_MNT=/mnt/scratch
270                 TAPE_DEV=/dev/st0
271                 RMT_TAPE_DEV=longhorn:/dev/tape
272                 # RMT_IRIXTAPE_DEV=longhorn:/dev/tape
273                 RMT_TAPE_USER=guest
274                 ;;
275             lab343)
276                 MODULAR=0
277                 EMAIL="hch@sgi.com"
278                 TEST_DEV=/dev/sdb1
279                 SCRATCH_DEV=/dev/sdb2
280                 SCRATCH_LOGDEV=/dev/sdb5
281                 SCRATCH_RTDEV=/dev/sdb6
282                 TEST_DIR=/qa/test
283                 SCRATCH_MNT=/qa/scratch
284                 ;;
285             dribble)
286                 #dedicated qa machine
287                 MODULAR=0
288                 EMAIL="ddiss@sgi.com"
289                 TEST_DIR=/mnt/test
290                 TEST_DEV=/dev/dsk/dks0d2s0
291                 SCRATCH_MNT=/mnt/scratch
292                 SCRATCH_DEV=/dev/dsk/dks0d2s6
293                 #TAPE_DEV=/dev/tape
294                 #RMT_TAPE_DEV=icy:/dev/st0
295                 #RMT_TAPE_USER=guest
296                 ;;
297              giro)
298                 MODULAR=0
299                 EMAIL="ddiss@sgi.com"
300                 TEST_DIR=/mnt/test
301                 TEST_DEV=/dev/dsk/dks0d2s0
302                 SCRATCH_MNT=/mnt/scratch
303                 SCRATCH_DEV=/dev/dsk/dks0d2s6
304                 #TAPE_DEV=/dev/tape
305                 #RMT_TAPE_DEV=icy:/dev/st0
306                 #RMT_TAPE_USER=guest
307                 ;;
308             cxfsirix1)
309                 EMAIL="ajones@sgi.com"
310                 TEST_DIR=/mnt/xfs_test0
311                 TEST_DEV=/dev/cxvm/xfs_test0
312                 SCRATCH_MNT=/mnt/xfs_test1
313                 SCRATCH_DEV=/dev/cxvm/xfs_test1
314                 ;;
315             hammer)
316                 EMAIL="bnaujok@sgi.com"
317                 TEST_DIR=/mnt/test
318                 TEST_DEV=/dev/sda5
319                 SCRATCH_MNT=/mnt/scratch
320                 SCRATCH_DEV=/dev/sda6
321                 ;;
322             emu)
323                 MODULAR=0
324                 EMAIL="vapo@sgi.com"
325                 TEST_DIR=/mnt/test
326                 TEST_DEV=/dev/sdb1
327                 SCRATCH_MNT=/mnt/scratch1
328                 SCRATCH_DEV=/dev/sdb2
329                 ;;
330             scaly)
331                 EMAIL="bnaujok@sgi.com"
332                 TEST_DIR=/mnt/test
333                 TEST_DEV=/dev/sdd3
334                 #TEST_LOGDEV=/dev/sdd1
335                 SCRATCH_MNT=/mnt/scratch
336                 SCRATCH_DEV=/dev/sdd4
337                 #SCRATCH_LOGDEV=/dev/sdd2
338                 ;;
339             cxfsaltix5)                                                                           
340                 EMAIL="leenap@sgi.com"                                                      
341                 TEST_DIR=/mnt/xfsdata                                                           
342                 TEST_DEV=/dev/lxvm/xfsdata                                                           
343                 #TEST_LOGDEV=/dev/sdd1                                                       
344                 SCRATCH_MNT=/mnt/xfsscratch                                                     
345                 SCRATCH_DEV=/dev/lxvm/xfsscratch                                                        
346                 #SCRATCH_LOGDEV=/dev/sdd2                                                    
347                 ;;
348             inferno)
349                 #dedicated qa machine (has some values already set)
350                 [ -z "$MODULAR" ] && MODULAR=1
351                 EMAIL="ajones@sgi.com"
352                 [ -z "$TEST_DIR" ] && TEST_DIR=/mnt/test
353                 [ -z "$TEST_DEV" ] && TEST_DEV=/dev/sdb1
354                 [ -z "$TEST_LOGDEV" ] && TEST_LOGDEV=/dev/ram0
355                 [ -z "$SCRATCH_MNT" ] && SCRATCH_MNT=/mnt/scratch
356                 [ -z "$SCRATCH_DEV" ] && SCRATCH_DEV=/dev/sdb2
357                 [ -z "$SCRATCH_LOGDEV" ] && SCRATCH_LOGDEV=/dev/ram1
358                 #[ -z "$SCRATCH_RTDEV" ] && SCRATCH_RTDEV=/dev/sdb5
359                 [ -z "$TAPE_DEV" ] && TAPE_DEV=/dev/st0
360                 ;;
361             hellfire)
362                 MODULAR=1
363                 EMAIL="ajones@sgi.com"
364                 TEST_DIR=/mnt/test
365                 TEST_DEV=/dev/sda3
366                 TEST_LOGDEV=/dev/sda5
367                 SCRATCH_MNT=/mnt/scratch
368                 SCRATCH_DEV=/dev/sda4
369                 SCRATCH_LOGDEV=/dev/sda6
370                 #SCRATCH_RTDEV=/dev/sda7
371                 TAPE_DEV=/dev/st0
372                 #RMT_IRIXTAPE_DEV=snort:/dev/tape
373                 #RMT_TAPE_DEV=icy:/dev/st0
374                 #RMT_TAPE_USER=guest
375                 ;;
376             rooster)
377                 MODULAR=1
378                 EMAIL="ajones@sgi.com"
379                 TEST_DIR=/mnt/test
380                 TEST_DEV=/dev/sdb1
381                 SCRATCH_MNT=/mnt/scratch
382                 SCRATCH_DEV=/dev/sdb2
383                 TAPE_DEV=/dev/st0
384                 #RMT_IRIXTAPE_DEV=snort:/dev/tape
385                 #RMT_TAPE_DEV=icy:/dev/st0
386                 #RMT_TAPE_USER=guest
387                 ;;
388             rosella)
389                 MODULAR=1
390                 EMAIL="ajones@sgi.com"
391                 TEST_DIR=/mnt/test
392                 TEST_DEV=/dev/sdb1
393                 SCRATCH_MNT=/mnt/scratch
394                 SCRATCH_DEV=/dev/sdb3
395                 TAPE_DEV=/dev/st0
396                 #RMT_IRIXTAPE_DEV=snort:/dev/tape
397                 #RMT_TAPE_DEV=icy:/dev/st0
398                 #RMT_TAPE_USER=guest
399                 ;;
400             crackle)
401                 #irix-crackle
402                 TEST_DIR=/mnt/xfs
403                 SCRATCH_MNT=/mnt/xfs2
404                 TEST_DEV=/dev/dsk/dks0d1s3
405                 SCRATCH_DEV=/dev/dsk/dks0d1s4
406                 ;;
407             tinkle)
408                 #irix-patchbox-tinkle
409                 TEST_DEV=/dev/dsk/dks0d2s0
410                 TEST_DIR=/mnt/xfs_test
411                 SCRATCH_DEV=/dev/dsk/dks0d2s1
412                 SCRATCH_MNT=/mnt/xfs_scratch
413                 ;;
414             cocky)
415                 MODULAR=1
416                 EMAIL="ajones@sgi.com"
417                 TEST_DIR=/mnt/test
418                 TEST_DEV=/dev/sdb1
419                 TEST_LOGDEV=/dev/sdb3
420                 SCRATCH_MNT=/mnt/scratch
421                 SCRATCH_DEV=/dev/sdb2
422                 SCRATCH_LOGDEV=/dev/sdb4
423                 #SCRATCH_RTDEV=/dev/sdb5
424                 TAPE_DEV=/dev/st0
425                 #RMT_IRIXTAPE_DEV=snort:/dev/tape
426                 #RMT_TAPE_DEV=icy:/dev/st0
427                 #RMT_TAPE_USER=guest
428                 ;;
429             porky)
430                 #dedicated qa machine (has some values already set)
431                 [ -z "$MODULAR" ] && MODULAR=1
432                 EMAIL="ajones@sgi.com"
433                 [ -z "$TEST_DIR" ] && TEST_DIR=/mnt/test
434                 [ -z "$TEST_DEV" ] && TEST_DEV=/dev/sdb1
435                 [ -z "$TEST_LOGDEV" ] && TEST_LOGDEV=/dev/sdb3
436                 [ -z "$SCRATCH_MNT" ] && SCRATCH_MNT=/mnt/scratch
437                 [ -z "$SCRATCH_DEV" ] && SCRATCH_DEV=/dev/sdb2
438                 [ -z "$SCRATCH_LOGDEV" ] && SCRATCH_LOGDEV=/dev/sdb4
439                 #[ -z "$SCRATCH_RTDEV" ] && SCRATCH_RTDEV=/dev/sdb7
440                 #[ -z "$TAPE_DEV" ] && TAPE_DEV=/dev/st0
441                 ;;
442             puffy)
443                 MODULAR=1
444                 EMAIL="tes@sgi.com"
445                 TEST_DIR=/mnt/test
446                 TEST_DEV=/dev/sda7
447                 SCRATCH_MNT=/mnt/scratch
448                 SCRATCH_DEV=/dev/sda8
449                 TAPE_DEV=/dev/st0
450                 ;;
451             galah)
452                 MODULAR=1
453                 EMAIL="ddiss@sgi.com"
454                 TEST_DIR=/mnt/data
455                 TEST_DEV=/dev/sdb1
456                 SCRATCH_MNT=/mnt/scratch
457                 SCRATCH_DEV=/dev/sda6
458                 #RMT_IRIXTAPE_DEV=snort:/dev/tape
459                 #RMT_TAPE_DEV=icy:/dev/st0
460                 #RMT_TAPE_USER=guest
461                 ;;
462              screamer)
463                 #dedicated qa machine (has some values already set)
464                 [ -z "$MODULAR" ] && MODULAR=1
465                 EMAIL="ddiss@sgi.com"
466                 [ -z "$TEST_DIR" ] && TEST_DIR=/mnt/test
467                 [ -z "$TEST_DEV" ] && TEST_DEV=/dev/sdb1
468                 #[ -z "$TEST_LOGDEV" ] && TEST_LOGDEV=/dev/sdb3
469                 [ -z "$SCRATCH_MNT" ] && SCRATCH_MNT=/mnt/scratch
470                 [ -z "$SCRATCH_DEV" ] && SCRATCH_DEV=/dev/sdb2
471                 #[ -z "$SCRATCH_LOGDEV" ] && SCRATCH_LOGDEV=/dev/sdb4
472                 #[ -z "$SCRATCH_RTDEV" ] && SCRATCH_RTDEV=/dev/sdb5
473                 ;;
474              linux-chatz)
475                 #vmware on pc-chatz
476                 MODULAR=1
477                 EMAIL="chatz@sgi.com"
478                 USE_EXTERNAL=yes
479                 TEST_DIR="/mnt/data"
480                 TEST_DEV=/dev/sdd
481                 TEST_LOGDEV=/dev/sdb
482                 SCRATCH_MNT=/mnt/scratch
483                 SCRATCH_DEV=/dev/sdg
484                 SCRATCH_LOGDEV=/mnt/sde
485                 ;;
486              chapter11)
487                 [ -z "$MODULAR" ] && MODULAR=1
488                 EMAIL="ddiss@sgi.com"
489                 [ -z "$TEST_DIR" ] && TEST_DIR=/mnt/test
490                 [ -z "$TEST_DEV" ] && TEST_DEV=/dev/sdb6
491                 [ -z "$SCRATCH_MNT" ] && SCRATCH_MNT=/mnt/scratch
492                 [ -z "$SCRATCH_DEV" ] && SCRATCH_DEV=/dev/sdb7
493                 ;;
494              dassi)
495                 MODULAR=0
496                 EMAIL="ddiss@sgi.com"
497                 TEST_DIR=/mnt/test
498                 TEST_DEV=/dev/dsk/dks0d2s0
499                 SCRATCH_MNT=/mnt/scratch
500                 SCRATCH_DEV=/dev/dsk/dks0d2s6
501                 ;;
502              molten)
503                 [ -z "$MODULAR" ] && MODULAR=1
504                 EMAIL="ddiss@sgi.com"
505                 [ -z "$TEST_DIR" ] && TEST_DIR=/mnt/test
506                 [ -z "$TEST_DEV" ] && TEST_DEV=/dev/sdb5
507                 [ -z "$SCRATCH_MNT" ] && SCRATCH_MNT=/mnt/scratch
508                 [ -z "$SCRATCH_DEV" ] && SCRATCH_DEV=/dev/sdb6
509                 ;;
510              *)
511                 echo "Error: need to define parameters for host $HOST"
512                 exit 1
513                 ;;
514         esac
515 }
516
517 if [ -f "$HOST_OPTIONS" ]; then
518     . "$HOST_OPTIONS"
519 else
520     known_hosts
521 fi
522
523 echo $TEST_DEV | grep -q ":" > /dev/null 2>&1
524 if [ ! -b "$TEST_DEV" -a "$?" != "0" ]
525 then
526     echo "common.config: Error: \$TEST_DEV ($TEST_DEV) is not a block device or a NFS filesystem"
527     exit 1
528 fi
529
530 if [ ! -d "$TEST_DIR" ]
531 then
532     echo "common.config: Error: \$TEST_DIR ($TEST_DIR) is not a directory"
533     exit 1
534 fi
535
536 echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
537 if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" -a "$?" != "0" ]
538 then
539     echo "common.config: Error: \$SCRATCH_DEV ($SCRATCH_DEV) is not a block device or a NFS filesystem"
540     exit 1
541 fi
542
543 if [ ! -z "$SCRATCH_MNT" -a ! -d "$SCRATCH_MNT" ]
544 then
545     echo "common.config: Error: \$SCRATCH_MNT ($SCRATCH_MNT) is not a directory"
546     exit 1
547 fi
548
549 _readlink()
550 {
551     if [ $# -ne 1 ]
552     then
553         echo "Usage: _readlink filename" 1>&2
554         exit 1
555     fi
556
557     perl -e "\$in=\"$1\";" -e '
558         $lnk = readlink($in);
559         if ($lnk =~ m!^/.*!) {
560           print "$lnk\n";
561         }
562         else {
563           chomp($dir = `dirname $in`);
564           print "$dir/$lnk\n";
565         }'
566 }
567
568 # if devfs is running expand the full /dev/.. pathname - this is what will be
569 # returned by utilities such as mount
570 [ -L "$TEST_DEV" ] && TEST_DEV=`_readlink $TEST_DEV`
571 [ -L "$SCRATCH_DEV" ] && SCRATCH_DEV=`_readlink $SCRATCH_DEV`
572 [ -L "$SCRATCH_LOGDEV" ] && SCRATCH_LOGDEV=`_readlink $SCRATCH_LOGDEV`
573 [ -L "$SCRATCH_RTDEV" ] && SCRATCH_RTDEV=`_readlink $SCRATCH_LOGDEV`
574
575 # make sure this script returns success
576 /bin/true