Add GPL license plate to SGI's test files.
[xfstests-dev.git] / 091
1 #! /bin/sh
2 #
3 #-----------------------------------------------------------------------
4 # Copyright (c) 2000-2004 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. 091
22 #
23 # fsx exercising direct IO -- sub-block sizes and concurrent buffered IO
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=1        # failure is the default!
34 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
35
36 # get standard environment, filters and checks
37 . ./common.rc
38 . ./common.filter
39
40 # real QA test starts here
41 _supported_fs xfs
42 _supported_os Linux IRIX
43
44 [ $HOSTOS == IRIX ] && _notrun "Not working on IRIX yet"
45
46 rm -f $seq.full
47
48 run_fsx()
49 {
50         echo fsx $@ | tee -a $seq.full | sed -e "s/ $bsize / BSIZE /g" -e "s/ $psize / PSIZE /g"
51         rm -f $TEST_DIR/junk
52         $here/ltp/fsx $@ $TEST_DIR/junk >>$seq.full 2>&1
53         if [ $? -ne 0 ]; then
54                 cat $seq.full
55                 exit 1
56         fi
57 }
58
59 psize=`$here/src/feature -s`
60 bsize=512
61 kernel=`uname -r  | sed -e 's/\(2\..\).*/\1/'`
62
63 # 2.4 Linux kernels support bsize aligned direct I/O only
64 [ "$HOSTOS" = "Linux" -a "$kernel" = "2.4" ] && bsize=$psize
65
66 # 2.6 Linux kernels support sector aligned direct I/O only
67 if [ "$HOSTOS" = "Linux" -a "$kernel" = "2.6" ]; then
68         xfs_info $TEST_DIR | _filter_mkfs 2> $tmp.info > /dev/null
69         if [ $? -eq 0 ]; then
70                 source $tmp.info
71                 bsize=$sectsz
72         fi
73 fi
74
75 # fsx usage:
76
77 # -N numops: total # operations to do 
78 # -l flen: the upper bound on file size 
79 # -o oplen: the upper bound on operation size (64k default)
80 # -r readbdy: $psize would make reads page aligned (on i386)
81 # -t truncbdy: $psize would make truncates page aligned (on i386)
82 # -w writebdy: $psize would make writes page aligned (on i386)
83
84 # -Z: O_DIRECT (use -R, -W, -r and -w too)
85 # -R: mapped read operations DISabled
86 # -W: mapped write operations DISabled
87
88 #run_fsx -N 10000            -l 500000 -r $psize -t $psize -w $psize -Z -R -W
89  run_fsx -N 10000            -l 500000 -r $psize -t $bsize -w $bsize -Z -R -W
90  run_fsx -N 10000  -o 8192   -l 500000 -r $psize -t $bsize -w $bsize -Z -R -W
91 #run_fsx -N 10000  -o 16384  -l 500000 -r $psize -t $psize -w $psize -Z -R -W
92  run_fsx -N 10000  -o 32768  -l 500000 -r $psize -t $bsize -w $bsize -Z -R -W
93 #run_fsx -N 10000  -o 128000 -l 500000 -r $psize -t $psize -w $psize -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 -W
98  run_fsx -N 10000  -o 128000 -l 500000 -r $psize -t $bsize -w $bsize -Z -W
99
100 # Commented out calls above are less likely to pick up issues, so
101 # save time by commenting them out (leave 'em for manual testing).
102
103 status=0
104 exit