Add a test to run fsx with the AIO flag switched on, in combination with various...
[xfstests-dev.git] / 091
1 #! /bin/sh
2 # FS QA Test No. 091
3 #
4 # fsx exercising direct IO -- sub-block sizes and concurrent buffered IO
5 #
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
8
9 # This program is free software; you can redistribute it and/or modify it
10 # under the terms of version 2 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, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17 # Further, this software is distributed without any warranty that it is
18 # free of the rightful claim of any third person regarding infringement
19 # or the like.  Any license provided herein, whether implied or
20 # otherwise, applies only to this software file.  Patent licenses, if
21 # any, provided herein do not apply to combinations of this program with
22 # other software, or any other product whatsoever.
23
24 # You should have received a copy of the GNU General Public License along
25 # with this program; if not, write the Free Software Foundation, Inc., 59
26 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
27
28 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
29 # Mountain View, CA  94043, or:
30
31 # http://www.sgi.com 
32
33 # For further information regarding this notice, see: 
34
35 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
36 #-----------------------------------------------------------------------
37 #
38 # creator
39 owner=nathans@sgi.com
40
41 seq=`basename $0`
42 echo "QA output created by $seq"
43
44 here=`pwd`
45 tmp=/tmp/$$
46 status=1        # failure is the default!
47 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
48
49 # get standard environment, filters and checks
50 . ./common.rc
51 . ./common.filter
52
53 # real QA test starts here
54 _supported_fs xfs
55 _supported_os Linux IRIX
56
57 [ $HOSTOS == IRIX ] && _notrun "Not working on IRIX yet"
58
59 rm -f $seq.full
60
61 run_fsx()
62 {
63         echo fsx $@ | tee -a $seq.full | sed -e "s/ $bsize / BSIZE /g" -e "s/ $psize / PSIZE /g"
64         rm -f $TEST_DIR/junk
65         $here/ltp/fsx $@ $TEST_DIR/junk > $tmp.stdout 2> $tmp.stderr
66         if [ $? -ne 0 ]; then
67                 cat $tmp.stdout
68                 cat $tmp.stderr
69                 exit 1
70         fi
71 }
72
73 psize=`$here/src/feature -p`
74 bsize=512
75 # 2.4 Linux kernels support bsize aligned direct I/O only
76 kernel=`uname -r  | sed -e 's/\(2\..\).*/\1/'`
77 [ "$HOSTOS" = "Linux" -a "$kernel" = "2.4" ] && bsize=$psize
78
79 # fsx usage:
80
81 # -N numops: total # operations to do 
82 # -l flen: the upper bound on file size 
83 # -o oplen: the upper bound on operation size (64k default)
84 # -r readbdy: $psize would make reads page aligned (on i386)
85 # -t truncbdy: $psize would make truncates page aligned (on i386)
86 # -w writebdy: $psize would make writes page aligned (on i386)
87
88 # -Z: O_DIRECT (use -R, -W, -r and -w too)
89 # -R: mapped read operations DISabled
90 # -W: mapped write operations DISabled
91
92 #run_fsx -N 10000            -l 500000 -r $psize -t $psize -w $psize -Z -R -W
93  run_fsx -N 10000            -l 500000 -r $psize -t $bsize -w $bsize -Z -R -W
94  run_fsx -N 10000  -o 8192   -l 500000 -r $psize -t $bsize -w $bsize -Z -R -W
95 #run_fsx -N 10000  -o 16384  -l 500000 -r $psize -t $psize -w $psize -Z -R -W
96  run_fsx -N 10000  -o 32768  -l 500000 -r $psize -t $bsize -w $bsize -Z -R -W
97 #run_fsx -N 10000  -o 128000 -l 500000 -r $psize -t $psize -w $psize -Z -R -W
98  run_fsx -N 10000  -o 8192   -l 500000 -r $psize -t $bsize -w $bsize -Z -R -W
99 #run_fsx -N 10000  -o 16384  -l 500000 -r $psize -t $psize -w $psize -Z -R -W
100  run_fsx -N 10000  -o 32768  -l 500000 -r $psize -t $bsize -w $bsize -Z -R -W
101 #run_fsx -N 10000  -o 128000 -l 500000 -r $psize -t $psize -w $psize -Z -W
102  run_fsx -N 10000  -o 128000 -l 500000 -r $psize -t $bsize -w $bsize -Z -W
103
104 # Commented out calls above are less likely to pick up issues, so
105 # save time by commenting them out (leave 'em for manual testing).
106
107 status=0
108 exit