-##/bin/sh
+##/bin/bash
#
# Copyright (c) 2000-2003,2006 Silicon Graphics, Inc. All Rights Reserved.
#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms 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. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+#
# setup and check for config parameters, and in particular
#
# EMAIL - email of the script runner.
# 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_DEV - device you can make a scratch file system on
+# SCRATCH_MNT - mount point for scratch file system
# SCRATCH_LOGDEV - scratch log device for external log testing
# SCRATCH_RTDEV - scratch rt dev
# TEST_LOGDEV - test log device for external log testing
export FSSTRESS_PROG="`set_prog_path fsstress $PWD/ltp/fsstress`"
[ "$FSSTRESS_PROG" = "" ] && _fatal "fsstress not found"
-export NSLOOKUP_PROG="`set_prog_path nslookup`"
-[ "$NSLOOKUP_PROG" = "" ] && _fatal "nslookup not found"
-
export PERL_PROG="`set_prog_path perl`"
[ "$PERL_PROG" = "" ] && _fatal "perl not found"
export BC_PROG="`set_prog_path bc`"
[ "$BC_PROG" = "" ] && _fatal "bc not found"
-# Tests handle these if missing
-export ATTR_PROG="`set_prog_path attr`"
-export GETFATTR_PROG="`set_prog_path getfattr`"
-export CHACL_PROG="`set_prog_path chacl`"
-export KILLALL_PROG="`set_prog_path killall`"
-export INDENT_PROG="`set_prog_path indent`"
-
export PS_ALL_FLAGS="-ef"
export DF_PROG="`set_prog_path df`"
export XFS_DB_PROG="`set_prog_path xfs_db`"
export XFS_GROWFS_PROG=`set_prog_path xfs_growfs`
export XFS_IO_PROG="`set_prog_path xfs_io`"
-export XFS_COPY_PROG="`set_prog_path xfs_copy`"
export XFS_PARALLEL_REPAIR_PROG="`set_prog_path xfs_prepair`"
export XFS_PARALLEL_REPAIR64_PROG="`set_prog_path xfs_prepair64`"
export XFSDUMP_PROG="`set_prog_path xfsdump`"
export XFSRESTORE_PROG="`set_prog_path xfsrestore`"
export XFSINVUTIL_PROG="`set_prog_path xfsinvutil`"
-export XFS_QUOTA_PROG="`set_prog_path xfs_quota`"
+export DBENCH_PROG="`set_prog_path dbench`"
# Generate a comparable xfsprogs version number in the form of
# major * 10000 + minor * 100 + release
[ -f $HOST_CONFIG_DIR/$HOST ] && . $HOST_CONFIG_DIR/$HOST
[ -f $HOST_CONFIG_DIR/$HOST.config ] && . $HOST_CONFIG_DIR/$HOST.config
+ # Mandatory Config values.
MC=""
-# Non-Mandatory Config values.
-# [ -z "$MODULAR" ] && MC="$MC MODULAR"
-# [ -z "$TEST_LOGDEV" ] && MC="$MC TEST_LOGDEV"
-# [ -z "$SCRATCH_LOGDEV" ] && MC="$MC SCRATCH_LOGDEV"
-# [ -z "$SCRATCH_RTDEV" ] && MC="$MC SCRATCH_RTDEV"
-
[ -z "$EMAIL" ] && MC="$MC EMAIL"
[ -z "$TEST_DIR" ] && MC="$MC TEST_DIR"
[ -z "$TEST_DEV" ] && MC="$MC TEST_DEV"
- [ -z "$SCRATCH_MNT" ] && MC="$MC SCRATCH_MNT"
- [ -z "$SCRATCH_DEV" ] && MC="$MC SCRATCH_DEV"
-
- [ "$MC" ] && (echo "Warning: need to define parameters for host $HOST";\
- echo " or set variables:"; \
- echo " $MC")
-# if [ -e configs/$HOST.config ]
-# then echo "Not carring, we have a configfile ($HOST_CONFIG_DIR/$HOST)"
-# else
- [ "$MC" ] && exit 1
-# fi
+ if [ -n "$MC" ]; then
+ echo "Warning: need to define parameters for host $HOST"
+ echo " or set variables:"
+ echo " $MC"
+ exit 1
+ fi
}
if [ -f "$HOST_OPTIONS" ]; then
exit 1
fi
-_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";
- }'
-}
-
-# 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