remove misc & man directories, these have found new homes.
[xfstests-dev.git] / common.config
1 ##/bin/sh
2
3 #
4 # Copyright (c) 2000 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 #
52
53 #
54 # - This script is shared by the stress test system and the auto-qa
55 #   system
56 # - TEST_DEV & TEST_DIR must be assigned.
57 # - this script shouldn't make any assertions about filesystem
58 #   validity or mountedness.
59 #
60
61 _readlink()
62 {
63     if [ $# -ne 1 ]
64     then
65         echo "Usage: _readlink filename" 1>&2
66         exit 1
67     fi
68
69     perl -e "\$in=\"$1\";" -e '
70         $lnk = readlink($in);
71         if ($lnk =~ m!^/.*!) {
72           print "$lnk\n";
73         }
74         else {
75           chomp($dir = `dirname $in`);
76           print "$dir/$lnk\n";
77         }'
78 }
79
80
81 case `hostname -s`
82 in
83     fuzzy)
84         TEST_DEV=/dev/sda6
85         TEST_DIR=/mnt/xfs1
86         SCRATCH_DEV=/dev/sda5
87         SCRATCH_MNT=/mnt/xfs0
88         SCRATCH_LOGDEV=/dev/sda7
89         TAPE_DEV=/dev/st0
90         RMT_TAPE_DEV=fuzzy:/dev/st0
91         RMT_IRIXTAPE_DEV=snort:/dev/tape
92         ;;
93     bruce)
94         TEST_DEV=/dev/sda10
95         TEST_DIR=/mnt/xfs1
96         SCRATCH_DEV=/dev/sda9
97         SCRATCH_MNT=/mnt/xfs0
98         SCRATCH_LOGDEV=/dev/sda11
99         TAPE_DEV=/dev/st0
100         RMT_TAPE_DEV=bruce:/dev/st0
101         RMT_IRIXTAPE_DEV=snort:/dev/tape
102         ;;
103     sherman)
104         TEST_DEV=/dev/sda10
105         TEST_DIR=/mnt/xfs1
106         SCRATCH_DEV=/dev/sda9
107         SCRATCH_MNT=/mnt/xfs0
108         ;;
109     sagan)
110         TEST_DEV=/dev/sda6
111         TEST_DIR=/mnt/xfs0
112         SCRATCH_DEV=/dev/sda7
113         SCRATCH_MNT=/mnt/xfs1
114         TAPE_DEV=/dev/st0
115         RMT_TAPE_DEV=sagan:/dev/st0
116         RMT_IRIXTAPE_DEV=snort:/dev/tape
117         ;;
118     leesa)
119         TEST_DEV=/dev/xfs_test
120         TEST_DIR=/mnt/xfs_test
121         SCRATCH_DEV=/dev/xfs_scratch
122         SCRATCH_MNT=/mnt/xfs_scratch
123         SCRATCH_LOGDEV=/dev/xfs_log
124         ;;
125     troppo)
126         TEST_DEV=/dev/hdb6
127         TEST_DIR=/mnt/test
128         SCRATCH_DEV=/dev/hdb7
129         SCRATCH_MNT=/mnt/scratch
130         SCRATCH_LOGDEV=/dev/hdb9
131         SCRATCH_RTDEV=/dev/hdb10
132         ;;
133     lord)
134         TEST_DIR=/xfs
135         TEST_DEV=/dev/sda4
136         SCRATCH_DEV=/dev/hda2
137         SCRATCH_MNT=/xfs1
138         ;;
139     lumpy)
140         TEST_DEV=/dev/sdc5
141         TEST_DIR=/mnt/scratch_0
142         SCRATCH_DEV=/dev/sdc7
143         SCRATCH_MNT=/mnt/scratch_2
144         ;;
145     bongo)
146         TEST_DEV=/dev/hda8
147         TEST_DIR=/xfs1
148         SCRATCH_DEV=/dev/hda9
149         SCRATCH_MNT=/xfs2
150         SCRATCH_LOGDEV=/dev/hda10
151         SCRATCH_RTDEV=/dev/hda11
152         ;;
153     snowy)
154         TEST_DEV=/dev/sda7
155         TEST_DIR=/mnt/xfs0
156         SCRATCH_DEV=/dev/sda8
157         SCRATCH_MNT=/mnt/xfs1
158         SCRATCH_LOGDEV=/dev/sda9
159         ;;
160
161     *)
162         echo "common.config: Error: need to define parameters for host `hostname -s`"
163         exit 1
164         ;;
165 esac
166
167 if [ ! -b "$TEST_DEV" ]
168 then
169     echo "common.config: Error: \$TEST_DEV ($TEST_DEV) is not a block device"
170     exit 1
171 fi
172
173 if [ ! -d "$TEST_DIR" ]
174 then
175     echo "common.config: Error: \$TEST_DIR ($TEST_DIR) is not a directory"
176     exit 1
177 fi
178
179 if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" ]
180 then
181     echo "common.config: Error: \$SCRATCH_DEV ($SCRATCH_DEV) is not a block device"
182     exit 1
183 fi
184
185 if [ ! -z "$SCRATCH_DEV" -a ! -d "$SCRATCH_MNT" ]
186 then
187     echo "common.config: Error: \$SCRATCH_MNT ($SCRATCH_MNT) is not a directory"
188     exit 1
189 fi
190
191 # if devfs is running expand the full /dev/.. pathname - this is what will be
192 # returned by utilities such as mount
193 [ -L "$TEST_DEV" ] && TEST_DEV=`_readlink $TEST_DEV`
194 [ -L "$SCRATCH_DEV" ] && SCRATCH_DEV=`_readlink $SCRATCH_DEV`
195 [ -L "$SCRATCH_LOGDEV" ] && SCRATCH_LOGDEV=`_readlink $SCRATCH_LOGDEV`
196 [ -L "$SCRATCH_RTDEV" ] && SCRATCH_RTDEV=`_readlink $SCRATCH_LOGDEV`
197
198 # make sure this script returns success
199 /bin/true