3 #-----------------------------------------------------------------------
4 # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #-----------------------------------------------------------------------
23 # fsx (AIO variant, based on 075)
29 echo "QA output created by $seq"
33 status=0 # success is the default!
34 trap "_cleanup; exit \$status" 0 1 2 3 15
39 rm -rf $testdir/fsx.* $tmp.*
43 # get standard environment, filters and checks
56 echo " failed to mkdir $out"
61 _filter_param=`echo "$_param" | sed\
62 -e 's/-N [0-9][0-9]*/-N numops/' \
63 -e 's/-l [0-9][0-9]*/-l filelen/'`
66 echo "-----------------------------------------------"
67 echo "fsx.$_n : $_filter_param"
68 echo "-----------------------------------------------"
70 # This cd and use of -P gets full debug on $here (not TEST_DEV)
72 if ! $here/ltp/fsx $_param -P $here $seq.$_n >/dev/null
74 echo " fsx ($_param) returned $? - see $seq.$_n.full"
75 mv $seq.$_n.fsxlog $here/$seq.$_n.full
86 echo "$0: [-l filelen] [-n numops1] [-N numops2]"
91 while getopts "l:n:N:?" c $@
97 param_type="$param_type, overidde -l"
101 param_type="$param_type, overidde -N"
105 param_type="$param_type, overidde -n"
116 # real QA test starts here
120 [ -x $here/ltp/aio-stress ] || \
121 _notrun "fsx not built with AIO for this platform"
123 size10=`expr 10 \* 1024 \* 1024` # 10 megabytes
128 # can override the params here
131 echo "Params are for $param_type" >>$seq.full
132 echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seq.full
136 rm -f $here/$seq.full
137 echo "brevity is wit..."
142 # -d: debug output for all operations
143 # -l flen: the upper bound on file size (default 262144)
144 # -o oplen: the upper bound on operation size
145 # -N numops: total # operations to do (default infinity)
146 # -P: save .fsxlog and .fsxgood files in dirpath (default ./)
147 # -S seed: for random # generator (default 1) 0 gets timestamp
148 # -x: pre-allocate file space, exercising unwritten extents
149 # -A: use the AIO system calls
151 _do_test 0 "-A -d -N $numops1 -S 0"
152 _do_test 1 "-A -d -N $numops1 -S 0 -x"
153 _do_test 2 "-A -d -N $numops2 -l $filelen -S 0"
154 _do_test 3 "-A -d -N $numops2 -l $filelen -S 0 -x"
156 rm -f $seq.*.fsx{good,log}