00b577cd1e192739768d6f07cb075e9160d8982c
[xfstests-dev.git] / 113
1 #! /bin/sh
2 #
3 #-----------------------------------------------------------------------
4 # Copyright (c) 2005 Silicon Graphics, Inc.  All Rights Reserved.
5 #
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
9 #
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 #
19 #-----------------------------------------------------------------------
20 #
21 # FS QA Test No. 113
22 #
23 # aio-stress
24 #
25 # creator
26 owner=nathans@sgi.com
27
28 seq=`basename $0`
29 echo "QA output created by $seq"
30
31 here=`pwd`
32 tmp=/tmp/$$
33 status=0        # success is the default!
34 trap "_cleanup; exit \$status" 0 1 2 3 15
35
36 _cleanup()
37 {
38     cd /
39     rm -f $testdir/aio-stress.$$.*
40     _cleanup_testdir
41 }
42
43 # get standard environment, filters and checks
44 . ./common.rc
45 . ./common.filter
46
47 _do_test()
48 {
49     _n="$1"
50     _param="$2"
51     _count="$3"
52     _nproc="$4"
53
54     _files="$testdir/aiostress.$$.$_n"
55     __proc=$_nproc
56     [ $__proc -gt 1 ] && _param="-t $__proc $_param"
57     while [ $__proc -gt 1 ]; do
58         _files="$_files $testdir/aiostress.$$.$_n.$__proc"
59         let __proc=$__proc-1
60     done
61     rm -f $_files
62  
63     echo ""
64     echo "-----------------------------------------------"
65     echo "aio-stress.$_n : $_param"
66     echo "-----------------------------------------------"
67     if ! $here/ltp/aio-stress $_param $AIOSTRESS_AVOID -I $_count $_files >>$tmp.out 2>&1
68     then
69         echo "    aio-stress (count=$_count) returned $?"
70         cat $tmp.out
71         status=1
72         exit
73     fi
74
75     _check_test_fs
76     rm -f $_files
77 }
78
79
80 # real QA test starts here
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