2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
7 # fsx (non-AIO variant)
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 if [ "$FSTYP" != "xfs" ]
53 if [ "$_n" = "1" -o "$_n" = "3" ]
55 # HACK: only xfs handles preallocation (-x) so just skip this test
60 # This cd and use of -P gets full debug on $here (not TEST_DEV)
62 if ! $here/ltp/fsx $_param -P $here $seq.$_n $FSX_AVOID &>/dev/null
64 echo " fsx ($_param) failed, $? - compare $seqres.$_n.{good,bad,fsxlog}"
65 mv $out/$seq.$_n $seqres.$_n.full
66 mv $here/$seq.$_n.fsxlog $seqres.$_n.fsxlog
67 od -xAx $seqres.$_n.full > $seqres.$_n.bad
68 od -xAx $here/$seq.$_n.fsxgood > $seqres.$_n.good
69 rm -f $here/$seq.$_n.fsxgood
80 echo "$0: [-l filelen] [-n numops1] [-N numops2]"
86 while getopts "l:n:N:?" c $@
92 param_type="$param_type, overidde -l"
96 param_type="$param_type, overidde -N"
100 param_type="$param_type, overidde -n"
110 # real QA test starts here
111 _supported_fs generic
115 size10=`expr 10 \* 1024 \* 1024` # 10 megabytes
120 # can override the params here
123 echo "Params are for $param_type" >>$seqres.full
124 echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full
127 echo "brevity is wit..."
132 # -d: debug output for all operations
133 # -l flen: the upper bound on file size (default 262144)
134 # -o oplen: the upper bound on operation size
135 # -N numops: total # operations to do (default infinity)
136 # -P: save .fsxlog and .fsxgood files in dirpath (default ./)
137 # -S seed: for random # generator (default 1) 0 gets timestamp
138 # -x: pre-allocate file space, exercising unwritten extents
140 _do_test 0 "-d -N $numops1 -S 0"
141 _do_test 1 "-d -N $numops1 -S 0 -x"
142 _do_test 2 "-d -N $numops2 -l $filelen -S 0"
143 _do_test 3 "-d -N $numops2 -l $filelen -S 0 -x"
145 rm -f $seq.*.fsx{good,log}