2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
7 # fsx (AIO variant, based on 075)
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=0 # success is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
21 rm -rf $TEST_DIR/fsx.* $tmp.*
24 # get standard environment, filters and checks
37 echo " failed to mkdir $out"
42 _filter_param=`echo "$_param" | sed\
43 -e 's/-N [0-9][0-9]*/-N numops/' \
44 -e 's/-l [0-9][0-9]*/-l filelen/'`
47 echo "-----------------------------------------------"
48 echo "fsx.$_n : $_filter_param"
49 echo "-----------------------------------------------"
51 # Skip the prealloc runs if the file system does not support preallocation
52 if [ "$_n" = "1" -o "$_n" = "3" ]; then
53 if [ -n "$testio" ]; then
58 # This cd and use of -P gets full debug on "$RESULT_DIR" (not TEST_DEV)
60 if ! $here/ltp/fsx $_param -P "$RESULT_DIR" $FSX_AVOID $seq.$_n &>/dev/null
62 echo " fsx ($_param) returned $? - see $seq.$_n.full"
63 mv "$RESULT_DIR"/$seq.$_n.fsxlog $seqres.$_n.full
74 echo "$0: [-l filelen] [-n numops1] [-N numops2]"
80 while getopts "l:n:N:?" c $@
86 param_type="$param_type, overidde -l"
90 param_type="$param_type, overidde -N"
94 param_type="$param_type, overidde -n"
104 # real QA test starts here
105 _supported_fs generic
110 [ -x $here/ltp/aio-stress ] || \
111 _notrun "fsx not built with AIO for this platform"
113 size10=`expr 10 \* 1024 \* 1024` # 10 megabytes
118 # can override the params here
121 echo "Params are for $param_type" >>$seqres.full
122 echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full
125 echo "brevity is wit..."
129 # check if preallocation is supported, xfs_io resvsp command only prints out
130 # messages on failure.
131 testfile=$TEST_DIR/$$.xfs_io
132 testio=`$XFS_IO_PROG -f -c "resvsp 0 1" $testfile 2>&1`
133 rm -f $testfile 2>&1 > /dev/null
136 # -d: debug output for all operations
137 # -l flen: the upper bound on file size (default 262144)
138 # -o oplen: the upper bound on operation size
139 # -N numops: total # operations to do (default infinity)
140 # -P: save .fsxlog and .fsxgood files in dirpath (default ./)
141 # -S seed: for random # generator (default 1) 0 gets timestamp
142 # -x: pre-allocate file space, exercising unwritten extents
143 # -A: use the AIO system calls
145 _do_test 0 "-A -d -N $numops1 -S 0"
146 _do_test 1 "-A -d -N $numops1 -S 0 -x"
147 _do_test 2 "-A -d -N $numops2 -l $filelen -S 0"
148 _do_test 3 "-A -d -N $numops2 -l $filelen -S 0 -x"
150 rm -f $seq.*.fsx{good,log}