[BACK]Return to 074 CVS log [TXT][DIR] Up to [Development] / xfs-cmds / xfstests

File: [Development] / xfs-cmds / xfstests / 074 (download)

Revision 1.4, Thu Aug 5 06:39:05 2004 UTC (13 years, 2 months ago) by tes
Branch: MAIN
Changes since 1.3: +1 -1 lines

Some qa changes to get more tests working on IRIX.
Reduce a param to get it working in a more reasonable time on irix.

#! /bin/sh
# FS QA Test No. 074
#
# 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()
{
    cd /
    rm -rf $testdir/fstest.$$.* $tmp.*
    _cleanup_testdir
}

# get standard environment, filters and checks
. ./common.rc
. ./common.filter

_do_test()
{
    _n="$1"
    _param="$2"

    out=$testdir/fstest.$$.$_n
    rm -rf $out
    if ! mkdir $out
    then
        echo "    failed to mkdir $out"
        status=1
        exit
    fi

    _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/'`
    
    echo ""
    echo "-----------------------------------------------"
    echo "fstest.$_n : $_filter_param"
    echo "-----------------------------------------------"
    if ! $here/src/fstest $_param -p $out >>$seq.full
    then
        echo "    fstest ($_param) returned $? - see $seq.full"
        status=1
	exit
    fi

    _check_test_fs
}

_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
}


# real QA test starts here
rm -f $here/$seq.full

_supported_fs xfs udf nfs
_supported_os IRIX Linux

#
# set params
# These params can take a while on different CPUs/OSs
# so we set them differently for different machines
#
if [ $HOSTOS == "IRIX" ]; then 
    if uname -R | grep -i debug; then 
        # 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
	numfiles=3
	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

# 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

_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

_do_test 0 "-l $numloops"

_do_test 1 "-l $numloops -s $size10 -b 8192 -m"

_do_test 2 "-n $numchildren -F -l $numloops -f $numfiles -s $size30 -b 512"

_do_test 3 "-n $numchildren -F -l $numloops -f $numfiles -s $size30 -b 512 -m"