4 # fsx (AIO variant, based on 075)
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #-----------------------------------------------------------------------
26 echo "QA output created by $seq"
30 status=0 # success is the default!
31 trap "_cleanup; exit \$status" 0 1 2 3 15
36 rm -rf $testdir/fsx.* $tmp.*
40 # get standard environment, filters and checks
53 echo " failed to mkdir $out"
58 _filter_param=`echo "$_param" | sed\
59 -e 's/-N [0-9][0-9]*/-N numops/' \
60 -e 's/-l [0-9][0-9]*/-l filelen/'`
63 echo "-----------------------------------------------"
64 echo "fsx.$_n : $_filter_param"
65 echo "-----------------------------------------------"
67 if [ "$FSTYP" != "xfs" ]
69 if [ "$_n" = "1" -o "$_n" = "3" ]
71 # HACK: only xfs handles preallocation (-x) so just skip this test
76 # This cd and use of -P gets full debug on $here (not TEST_DEV)
78 if ! $here/ltp/fsx $_param -P $here $seq.$_n &>/dev/null
80 echo " fsx ($_param) returned $? - see $seq.$_n.full"
81 mv $seq.$_n.fsxlog $here/$seq.$_n.full
92 echo "$0: [-l filelen] [-n numops1] [-N numops2]"
97 while getopts "l:n:N:?" c $@
103 param_type="$param_type, overidde -l"
107 param_type="$param_type, overidde -N"
111 param_type="$param_type, overidde -n"
122 # real QA test starts here
123 _supported_fs generic
126 [ -x $here/ltp/aio-stress ] || \
127 _notrun "fsx not built with AIO for this platform"
129 size10=`expr 10 \* 1024 \* 1024` # 10 megabytes
134 # can override the params here
137 echo "Params are for $param_type" >>$seq.full
138 echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seq.full
142 rm -f $here/$seq.full
143 echo "brevity is wit..."
148 # -d: debug output for all operations
149 # -l flen: the upper bound on file size (default 262144)
150 # -o oplen: the upper bound on operation size
151 # -N numops: total # operations to do (default infinity)
152 # -P: save .fsxlog and .fsxgood files in dirpath (default ./)
153 # -S seed: for random # generator (default 1) 0 gets timestamp
154 # -x: pre-allocate file space, exercising unwritten extents
155 # -A: use the AIO system calls
157 _do_test 0 "-A -d -N $numops1 -S 0"
158 _do_test 1 "-A -d -N $numops1 -S 0 -x"
159 _do_test 2 "-A -d -N $numops2 -l $filelen -S 0"
160 _do_test 3 "-A -d -N $numops2 -l $filelen -S 0 -x"
162 rm -f $seq.*.fsx{good,log}