2003-08-01 03:38:46 +00:00
|
|
|
#! /bin/sh
|
2004-06-15 07:32:36 +00:00
|
|
|
# FS QA Test No. 074
|
2003-08-01 03:38:46 +00:00
|
|
|
#
|
|
|
|
|
# fstest
|
|
|
|
|
#
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
# Copyright (c) 2000-2003 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/
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
#
|
|
|
|
|
# creator
|
|
|
|
|
owner=nathans@sgi.com
|
|
|
|
|
|
|
|
|
|
seq=`basename $0`
|
|
|
|
|
echo "QA output created by $seq"
|
|
|
|
|
|
|
|
|
|
here=`pwd`
|
|
|
|
|
tmp=/tmp/$$
|
|
|
|
|
status=0 # success is the default!
|
|
|
|
|
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
|
|
|
|
|
|
|
_cleanup()
|
|
|
|
|
{
|
2004-06-15 07:32:36 +00:00
|
|
|
cd /
|
|
|
|
|
rm -rf $testdir/fstest.$$.* $tmp.*
|
|
|
|
|
_cleanup_testdir
|
2003-08-01 03:38:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# get standard environment, filters and checks
|
|
|
|
|
. ./common.rc
|
|
|
|
|
. ./common.filter
|
|
|
|
|
|
|
|
|
|
_do_test()
|
|
|
|
|
{
|
|
|
|
|
_n="$1"
|
|
|
|
|
_param="$2"
|
|
|
|
|
|
2004-06-15 07:32:36 +00:00
|
|
|
out=$testdir/fstest.$$.$_n
|
2003-08-01 03:38:46 +00:00
|
|
|
rm -rf $out
|
|
|
|
|
if ! mkdir $out
|
|
|
|
|
then
|
|
|
|
|
echo " failed to mkdir $out"
|
|
|
|
|
status=1
|
|
|
|
|
exit
|
|
|
|
|
fi
|
2004-07-27 05:53:41 +00:00
|
|
|
|
|
|
|
|
_filter_param=`echo "$_param" | sed\
|
|
|
|
|
-e 's/-n [0-9][0-9]*/-n children/' \
|
|
|
|
|
-e 's/-l [0-9][0-9]*/-l loops/' \
|
|
|
|
|
-e 's/-f [0-9][0-9]*/-f files/'`
|
2003-08-01 03:38:46 +00:00
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "-----------------------------------------------"
|
2004-07-27 05:53:41 +00:00
|
|
|
echo "fstest.$_n : $_filter_param"
|
2003-08-01 03:38:46 +00:00
|
|
|
echo "-----------------------------------------------"
|
2004-07-27 05:53:41 +00:00
|
|
|
if ! $here/src/fstest $_param -p $out >>$seq.full
|
2003-08-01 03:38:46 +00:00
|
|
|
then
|
|
|
|
|
echo " fstest ($_param) returned $? - see $seq.full"
|
|
|
|
|
status=1
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
_check_test_fs
|
|
|
|
|
}
|
|
|
|
|
|
2004-07-27 05:53:41 +00:00
|
|
|
_usage()
|
|
|
|
|
{
|
|
|
|
|
echo "$0: [-f files] [-l loops] [-n children]"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_process_args()
|
|
|
|
|
{
|
|
|
|
|
while getopts "f:l:n:?" c $@
|
|
|
|
|
do
|
|
|
|
|
case $c
|
|
|
|
|
in
|
|
|
|
|
f)
|
|
|
|
|
numfiles=$OPTARG
|
|
|
|
|
param_type="$param_type, overidde -f"
|
|
|
|
|
;;
|
|
|
|
|
l)
|
|
|
|
|
numloops=$OPTARG
|
|
|
|
|
param_type="$param_type, overidde -l"
|
|
|
|
|
;;
|
|
|
|
|
n)
|
|
|
|
|
numchildren=$OPTARG
|
|
|
|
|
param_type="$param_type, overidde -n"
|
|
|
|
|
;;
|
|
|
|
|
?)
|
|
|
|
|
_usage
|
|
|
|
|
exit
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
2003-08-01 03:38:46 +00:00
|
|
|
|
|
|
|
|
# real QA test starts here
|
2004-07-27 05:53:41 +00:00
|
|
|
rm -f $here/$seq.full
|
|
|
|
|
|
2004-06-15 07:32:36 +00:00
|
|
|
_supported_fs xfs udf nfs
|
|
|
|
|
_supported_os IRIX Linux
|
|
|
|
|
|
2004-07-27 05:53:41 +00:00
|
|
|
#
|
|
|
|
|
# set params
|
|
|
|
|
# These params can take a while on different CPUs/OSs
|
|
|
|
|
# so we set them differently for different machines
|
|
|
|
|
#
|
|
|
|
|
if [ $HOSTOS == "IRIX" ]; then
|
2004-08-10 03:55:47 +00:00
|
|
|
if uname -R | grep -iq debug; then
|
2004-07-27 05:53:41 +00:00
|
|
|
# e.g. getting around 37secs for 1,1,1 on IP30 debug
|
|
|
|
|
numchildren=2
|
|
|
|
|
numloops=1
|
|
|
|
|
numfiles=2
|
|
|
|
|
param_type="IRIX debug"
|
|
|
|
|
else
|
|
|
|
|
# getting around 1 sec 1,1,1 - 10secs 1,10,1 on IP30 nondebug
|
|
|
|
|
numloops=2
|
2004-08-05 06:39:05 +00:00
|
|
|
numfiles=3
|
2004-07-27 05:53:41 +00:00
|
|
|
numchildren=3
|
|
|
|
|
param_type="IRIX nondebug"
|
|
|
|
|
fi
|
|
|
|
|
elif [ $HOSTOS == "Linux" ]; then
|
|
|
|
|
numloops=10
|
|
|
|
|
numfiles=5
|
|
|
|
|
numchildren=3
|
|
|
|
|
param_type="Linux"
|
|
|
|
|
else
|
|
|
|
|
numloops=1
|
|
|
|
|
numfiles=1
|
|
|
|
|
numchildren=1
|
|
|
|
|
param_type="Default"
|
|
|
|
|
fi
|
2003-08-01 03:38:46 +00:00
|
|
|
|
2004-07-27 05:53:41 +00:00
|
|
|
# can override the params here
|
|
|
|
|
_process_args "$@"
|
|
|
|
|
|
|
|
|
|
echo "Params are for $param_type" >>$seq.full
|
|
|
|
|
echo "Params: n = $numchildren l = $numloops f = $numfiles" >>$seq.full
|
|
|
|
|
|
|
|
|
|
_setup_testdir
|
2003-08-01 03:38:46 +00:00
|
|
|
|
|
|
|
|
_check_test_fs
|
|
|
|
|
|
|
|
|
|
# Options:
|
|
|
|
|
# -F generate files with holes (default=no)
|
|
|
|
|
# -n num_children set number of child processes (default=1)
|
|
|
|
|
# -f num_files set number of files (default=1)
|
|
|
|
|
# -s file_size set file sizes (default=1MiB)
|
|
|
|
|
# -b block_size set block (IO) size (default=1024)
|
|
|
|
|
# -l loops set loop count (default=100)
|
|
|
|
|
# -m use mmap (default=no)
|
|
|
|
|
# -S use synchronous IO (default=no)
|
|
|
|
|
# -P preallocate space (default=no)
|
|
|
|
|
|
|
|
|
|
size10=`expr 10 \* 1024 \* 1024` # 10 megabytes
|
|
|
|
|
size30=`expr 30 \* 1024 \* 1024` # 30 megabytes
|
|
|
|
|
|
2004-07-27 05:53:41 +00:00
|
|
|
_do_test 0 "-l $numloops"
|
2003-08-01 03:38:46 +00:00
|
|
|
|
2004-07-27 05:53:41 +00:00
|
|
|
_do_test 1 "-l $numloops -s $size10 -b 8192 -m"
|
2003-08-01 03:38:46 +00:00
|
|
|
|
2004-07-27 05:53:41 +00:00
|
|
|
_do_test 2 "-n $numchildren -F -l $numloops -f $numfiles -s $size30 -b 512"
|
2003-08-01 03:38:46 +00:00
|
|
|
|
2004-07-27 05:53:41 +00:00
|
|
|
_do_test 3 "-n $numchildren -F -l $numloops -f $numfiles -s $size30 -b 512 -m"
|
2004-09-05 23:18:44 +00:00
|
|
|
|
|
|
|
|
_do_test 4 "-n $numchildren -F -l $numloops -f $numfiles -s $size10 -b 512 -mS"
|