xfstests: randholes: clean up readblks()
[xfstests-dev.git] / 113
1 #! /bin/bash
2 # FS QA Test No. 113
3 #
4 # aio-stress
5 #
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2005 Silicon Graphics, Inc.  All Rights Reserved.
8 #
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.
12 #
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.
17 #
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
21 #
22 #-----------------------------------------------------------------------
23 #
24 # creator
25 owner=nathans@sgi.com
26
27 seq=`basename $0`
28 echo "QA output created by $seq"
29
30 here=`pwd`
31 tmp=/tmp/$$
32 status=0        # success is the default!
33 trap "_cleanup; exit \$status" 0 1 2 3 15
34
35 _cleanup()
36 {
37     cd /
38     rm -f $testdir/aio-stress.$$.*
39     _cleanup_testdir
40 }
41
42 # get standard environment, filters and checks
43 . ./common.rc
44 . ./common.filter
45
46 _do_test()
47 {
48     _n="$1"
49     _param="$2"
50     _count="$3"
51     _nproc="$4"
52
53     _files="$testdir/aiostress.$$.$_n"
54     __proc=$_nproc
55     [ $__proc -gt 1 ] && _param="-t $__proc $_param"
56     while [ $__proc -gt 1 ]; do
57         _files="$_files $testdir/aiostress.$$.$_n.$__proc"
58         let __proc=$__proc-1
59     done
60     rm -f $_files
61  
62     echo ""
63     echo "-----------------------------------------------"
64     echo "aio-stress.$_n : $_param"
65     echo "-----------------------------------------------"
66     if ! $here/ltp/aio-stress $_param $AIOSTRESS_AVOID -I $_count $_files >>$tmp.out 2>&1
67     then
68         echo "    aio-stress (count=$_count) returned $?"
69         cat $tmp.out
70         status=1
71         exit
72     fi
73
74     _check_test_fs
75     rm -f $_files
76 }
77
78
79 # real QA test starts here
80 _supported_fs generic
81 _supported_os Linux
82
83 [ -x $here/ltp/aio-stress ] || _notrun "aio-stress not built for this platform"
84
85 _setup_testdir
86
87 echo "brevity is wit..."
88
89 count=1000
90 procs=20
91
92 _check_test_fs
93
94 # the default
95 _do_test 1 "-s 120m" $count 1
96
97 # and the default with multiprocess
98 _do_test 2 "-s 10m" $count $procs
99
100 # as above, but now using direct IO
101 _do_test 3 "-s 10m -O" $count $procs
102
103 exit