2001-01-15 05:01:19 +00:00
|
|
|
##/bin/sh
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
|
|
|
|
|
#
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify it
|
|
|
|
|
# under the terms of version 2 of the GNU General Public License as
|
|
|
|
|
# published by the Free Software Foundation.
|
|
|
|
|
#
|
|
|
|
|
# This program is distributed in the hope that it would be useful, but
|
|
|
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
#
|
|
|
|
|
# Further, this software is distributed without any warranty that it is
|
|
|
|
|
# free of the rightful claim of any third person regarding infringement
|
|
|
|
|
# or the like. Any license provided herein, whether implied or
|
|
|
|
|
# otherwise, applies only to this software file. Patent licenses, if
|
|
|
|
|
# any, provided herein do not apply to combinations of this program with
|
|
|
|
|
# other software, or any other product whatsoever.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
|
# with this program; if not, write the Free Software Foundation, Inc., 59
|
|
|
|
|
# Temple Place - Suite 330, Boston MA 02111-1307, USA.
|
|
|
|
|
#
|
|
|
|
|
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
|
|
|
|
|
# Mountain View, CA 94043, or:
|
|
|
|
|
#
|
|
|
|
|
# http://www.sgi.com
|
|
|
|
|
#
|
|
|
|
|
# For further information regarding this notice, see:
|
|
|
|
|
#
|
|
|
|
|
# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# setup and check for config parameters, and in particular
|
|
|
|
|
#
|
|
|
|
|
# TEST_DIR - scratch test directory that is in an already
|
|
|
|
|
# mounted XFS file system, needs to be be world
|
|
|
|
|
# writeable
|
|
|
|
|
# TEST_DEV - device for file system containing TEST_DIR
|
|
|
|
|
# SCRATCH_DEV - device you can make a scratch file system on
|
|
|
|
|
# SCRATCH_MNT - mount point for scratch file system
|
|
|
|
|
#
|
|
|
|
|
# and optionally:
|
|
|
|
|
# SCRATCH_LOGDEV - scratch log device for external log testing
|
|
|
|
|
# SCRATCH_RTDEV - scratch rt dev (only for testing cmds currently)
|
|
|
|
|
# TAPE_DEV - the tape device for the xfsdump tests
|
|
|
|
|
# RMT_TAPE_DEV - the remote tape device for the xfsdump tests
|
|
|
|
|
# RMT_IRIXTAPE_DEV - the IRIX remote tape device for the xfsdump tests
|
2001-05-09 08:38:23 +00:00
|
|
|
# RMT_TAPE_USER - remote user for tape device
|
2001-01-15 05:01:19 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# - This script is shared by the stress test system and the auto-qa
|
|
|
|
|
# system
|
|
|
|
|
# - TEST_DEV & TEST_DIR must be assigned.
|
|
|
|
|
# - this script shouldn't make any assertions about filesystem
|
|
|
|
|
# validity or mountedness.
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
_readlink()
|
|
|
|
|
{
|
|
|
|
|
if [ $# -ne 1 ]
|
|
|
|
|
then
|
|
|
|
|
echo "Usage: _readlink filename" 1>&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
perl -e "\$in=\"$1\";" -e '
|
|
|
|
|
$lnk = readlink($in);
|
|
|
|
|
if ($lnk =~ m!^/.*!) {
|
|
|
|
|
print "$lnk\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
chomp($dir = `dirname $in`);
|
|
|
|
|
print "$dir/$lnk\n";
|
|
|
|
|
}'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case `hostname -s`
|
|
|
|
|
in
|
|
|
|
|
fuzzy)
|
|
|
|
|
TEST_DEV=/dev/sda6
|
|
|
|
|
TEST_DIR=/mnt/xfs1
|
|
|
|
|
SCRATCH_DEV=/dev/sda5
|
|
|
|
|
SCRATCH_MNT=/mnt/xfs0
|
|
|
|
|
SCRATCH_LOGDEV=/dev/sda7
|
2001-02-01 05:49:23 +00:00
|
|
|
TAPE_DEV=/dev/st0
|
|
|
|
|
RMT_TAPE_DEV=fuzzy:/dev/st0
|
2001-02-02 04:31:55 +00:00
|
|
|
RMT_IRIXTAPE_DEV=snort:/dev/tape
|
2001-05-09 08:38:23 +00:00
|
|
|
RMT_TAPE_USER=guest
|
2001-01-15 05:01:19 +00:00
|
|
|
;;
|
|
|
|
|
bruce)
|
|
|
|
|
TEST_DEV=/dev/sda10
|
|
|
|
|
TEST_DIR=/mnt/xfs1
|
|
|
|
|
SCRATCH_DEV=/dev/sda9
|
|
|
|
|
SCRATCH_MNT=/mnt/xfs0
|
|
|
|
|
SCRATCH_LOGDEV=/dev/sda11
|
|
|
|
|
TAPE_DEV=/dev/st0
|
|
|
|
|
RMT_TAPE_DEV=bruce:/dev/st0
|
|
|
|
|
RMT_IRIXTAPE_DEV=snort:/dev/tape
|
|
|
|
|
;;
|
|
|
|
|
sherman)
|
|
|
|
|
TEST_DEV=/dev/sda10
|
|
|
|
|
TEST_DIR=/mnt/xfs1
|
|
|
|
|
SCRATCH_DEV=/dev/sda9
|
|
|
|
|
SCRATCH_MNT=/mnt/xfs0
|
|
|
|
|
;;
|
|
|
|
|
sagan)
|
|
|
|
|
TEST_DEV=/dev/sda6
|
|
|
|
|
TEST_DIR=/mnt/xfs0
|
|
|
|
|
SCRATCH_DEV=/dev/sda7
|
|
|
|
|
SCRATCH_MNT=/mnt/xfs1
|
|
|
|
|
TAPE_DEV=/dev/st0
|
|
|
|
|
RMT_TAPE_DEV=sagan:/dev/st0
|
|
|
|
|
RMT_IRIXTAPE_DEV=snort:/dev/tape
|
2001-05-09 08:38:23 +00:00
|
|
|
RMT_TAPE_USER=guest
|
2001-01-15 05:01:19 +00:00
|
|
|
;;
|
|
|
|
|
leesa)
|
|
|
|
|
TEST_DEV=/dev/xfs_test
|
|
|
|
|
TEST_DIR=/mnt/xfs_test
|
|
|
|
|
SCRATCH_DEV=/dev/xfs_scratch
|
|
|
|
|
SCRATCH_MNT=/mnt/xfs_scratch
|
|
|
|
|
SCRATCH_LOGDEV=/dev/xfs_log
|
|
|
|
|
;;
|
|
|
|
|
troppo)
|
2001-04-30 01:00:35 +00:00
|
|
|
TEST_DEV=/dev/hdb13
|
2001-01-15 05:01:19 +00:00
|
|
|
TEST_DIR=/mnt/test
|
2001-04-30 01:00:35 +00:00
|
|
|
SCRATCH_DEV=/dev/hdb14
|
2001-01-15 05:01:19 +00:00
|
|
|
SCRATCH_MNT=/mnt/scratch
|
2001-12-12 05:23:53 +00:00
|
|
|
SCRATCH_LOGDEV=/dev/hdb15
|
2001-01-15 05:01:19 +00:00
|
|
|
;;
|
|
|
|
|
lord)
|
|
|
|
|
TEST_DIR=/xfs
|
2001-10-11 20:47:01 +00:00
|
|
|
TEST_DEV=/dev/sda5
|
|
|
|
|
SCRATCH_DEV=/dev/sda6
|
|
|
|
|
SCRATCH_LOGDEV=/dev/hda7
|
|
|
|
|
SCRATCH_RTDEV=/dev/hda8
|
2001-01-15 05:01:19 +00:00
|
|
|
SCRATCH_MNT=/xfs1
|
|
|
|
|
;;
|
2002-01-15 15:36:08 +00:00
|
|
|
burst)
|
|
|
|
|
TEST_DIR=/xfs
|
|
|
|
|
TEST_DEV=/dev/hda3
|
|
|
|
|
SCRATCH_DEV=/dev/hda7
|
|
|
|
|
SCRATCH_MNT=/scratch
|
|
|
|
|
;;
|
2001-01-15 05:01:19 +00:00
|
|
|
lumpy)
|
|
|
|
|
TEST_DEV=/dev/sdc5
|
|
|
|
|
TEST_DIR=/mnt/scratch_0
|
|
|
|
|
SCRATCH_DEV=/dev/sdc7
|
|
|
|
|
SCRATCH_MNT=/mnt/scratch_2
|
|
|
|
|
;;
|
|
|
|
|
bongo)
|
|
|
|
|
TEST_DEV=/dev/hda8
|
|
|
|
|
TEST_DIR=/xfs1
|
|
|
|
|
SCRATCH_DEV=/dev/hda9
|
|
|
|
|
SCRATCH_MNT=/xfs2
|
|
|
|
|
SCRATCH_LOGDEV=/dev/hda10
|
|
|
|
|
SCRATCH_RTDEV=/dev/hda11
|
|
|
|
|
;;
|
2001-02-01 04:18:48 +00:00
|
|
|
snowy)
|
|
|
|
|
TEST_DEV=/dev/sda7
|
|
|
|
|
TEST_DIR=/mnt/xfs0
|
|
|
|
|
SCRATCH_DEV=/dev/sda8
|
|
|
|
|
SCRATCH_MNT=/mnt/xfs1
|
|
|
|
|
SCRATCH_LOGDEV=/dev/sda9
|
|
|
|
|
;;
|
2001-09-28 09:49:27 +00:00
|
|
|
surly)
|
|
|
|
|
TEST_DEV=/dev/hda9
|
|
|
|
|
TEST_DIR=/mnt/xfs1
|
|
|
|
|
SCRATCH_DEV=/dev/hda8
|
|
|
|
|
SCRATCH_MNT=/mnt/xfs0
|
|
|
|
|
SCRATCH_LOGDEV=/dev/hda10
|
|
|
|
|
TAPE_DEV=/dev/st0
|
|
|
|
|
RMT_TAPE_DEV=fuzzy:/dev/st0
|
|
|
|
|
RMT_IRIXTAPE_DEV=blub:/dev/tape
|
|
|
|
|
RMT_TAPE_USER=guest
|
|
|
|
|
;;
|
2001-10-08 20:19:06 +00:00
|
|
|
permit)
|
|
|
|
|
TEST_DEV=/dev/sdc1
|
|
|
|
|
TEST_DIR=/mnt/xfs0
|
|
|
|
|
SCRATCH_DEV=/dev/sdd1
|
|
|
|
|
SCRATCH_MNT=/mnt/xfs1
|
|
|
|
|
;;
|
|
|
|
|
indra)
|
|
|
|
|
TEST_DEV=/dev/sdb1
|
|
|
|
|
TEST_DIR=/mnt/xfs0
|
|
|
|
|
SCRATCH_DEV=/dev/sdb2
|
|
|
|
|
SCRATCH_MNT=/mnt/xfs1
|
|
|
|
|
;;
|
2002-01-11 04:01:45 +00:00
|
|
|
usermode)
|
|
|
|
|
TEST_DEV=/dev/ubd/1
|
|
|
|
|
TEST_DIR=/mnt/test
|
|
|
|
|
SCRATCH_DEV=/dev/ubd/2
|
|
|
|
|
SCRATCH_MNT=/mnt/scratch
|
|
|
|
|
SCRATCH_RTDEV=/dev/ubd/3
|
|
|
|
|
SCRATCH_LOGDEV=/dev/ubd/4
|
|
|
|
|
;;
|
2001-01-15 05:01:19 +00:00
|
|
|
*)
|
|
|
|
|
echo "common.config: Error: need to define parameters for host `hostname -s`"
|
|
|
|
|
exit 1
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
if [ ! -b "$TEST_DEV" ]
|
|
|
|
|
then
|
|
|
|
|
echo "common.config: Error: \$TEST_DEV ($TEST_DEV) is not a block device"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ ! -d "$TEST_DIR" ]
|
|
|
|
|
then
|
|
|
|
|
echo "common.config: Error: \$TEST_DIR ($TEST_DIR) is not a directory"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" ]
|
|
|
|
|
then
|
|
|
|
|
echo "common.config: Error: \$SCRATCH_DEV ($SCRATCH_DEV) is not a block device"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ ! -z "$SCRATCH_DEV" -a ! -d "$SCRATCH_MNT" ]
|
|
|
|
|
then
|
|
|
|
|
echo "common.config: Error: \$SCRATCH_MNT ($SCRATCH_MNT) is not a directory"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# if devfs is running expand the full /dev/.. pathname - this is what will be
|
|
|
|
|
# returned by utilities such as mount
|
|
|
|
|
[ -L "$TEST_DEV" ] && TEST_DEV=`_readlink $TEST_DEV`
|
|
|
|
|
[ -L "$SCRATCH_DEV" ] && SCRATCH_DEV=`_readlink $SCRATCH_DEV`
|
|
|
|
|
[ -L "$SCRATCH_LOGDEV" ] && SCRATCH_LOGDEV=`_readlink $SCRATCH_LOGDEV`
|
|
|
|
|
[ -L "$SCRATCH_RTDEV" ] && SCRATCH_RTDEV=`_readlink $SCRATCH_LOGDEV`
|
|
|
|
|
|
|
|
|
|
# make sure this script returns success
|
|
|
|
|
/bin/true
|