fstests: convert remaining tests to SPDX license tags
[xfstests-dev.git] / tests / generic / 113
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2005 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 113
6 #
7 # aio-stress
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=0        # success is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20     cd /
21     rm -f $TEST_DIR/aio-stress.$$.*
22 }
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27
28 _do_test()
29 {
30     _n="$1"
31     _param="$2"
32     _count="$3"
33     _nproc="$4"
34
35     _files="$TEST_DIR/aiostress.$$.$_n"
36     __proc=$_nproc
37     [ $__proc -gt 1 ] && _param="-t $__proc $_param"
38     while [ $__proc -gt 1 ]; do
39         _files="$_files $TEST_DIR/aiostress.$$.$_n.$__proc"
40         let __proc=$__proc-1
41     done
42     rm -f $_files
43  
44     echo ""
45     echo "-----------------------------------------------"
46     echo "aio-stress.$_n : $_param"
47     echo "-----------------------------------------------"
48     if ! $here/ltp/aio-stress $_param $AIOSTRESS_AVOID -I $_count $_files >>$tmp.out 2>&1
49     then
50         echo "    aio-stress (count=$_count) returned $?"
51         cat $tmp.out
52         status=1
53         exit
54     fi
55
56     _check_test_fs
57     rm -f $_files
58 }
59
60 # real QA test starts here
61 _supported_fs generic
62 _supported_os Linux
63 _require_test
64 _require_aio
65 _require_odirect
66
67 [ -x $here/ltp/aio-stress ] || _notrun "aio-stress not built for this platform"
68
69 echo "brevity is wit..."
70
71 count=1000
72 procs=20
73
74 _check_test_fs
75
76 # the default
77 _do_test 1 "-s 120m" $count 1
78
79 # and the default with multiprocess
80 _do_test 2 "-s 10m" $count $procs
81
82 # as above, but now using direct IO
83 _do_test 3 "-s 10m -O" $count $procs
84
85 # dio with O_SYNC and unwritten extent conversion
86 _do_test 4 "-s 10m -O -S" $count $procs
87
88 # random dio writes with O_SYNC and unwritten extent conversion
89 _do_test 5 "-s 10m -O -S -o 2" $count $procs
90
91 exit