Turn back on direct I/O in the testing mix
[xfstests-dev.git] / 041
1 #! /bin/sh
2 # XFS QA Test No. 041
3 # $Id: 041,v 1.3 2000/09/27 00:24:17 ajag Exp ajag $
4 #
5 # growfs QA tests - repeatedly fill/grow the filesystem
6 # check the filesystem contents after each operation
7 #
8 #-----------------------------------------------------------------------
9 # Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
10
11 # This program is free software; you can redistribute it and/or modify it
12 # under the terms of version 2 of the GNU General Public License as
13 # published by the Free Software Foundation.
14
15 # This program is distributed in the hope that it would be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18
19 # Further, this software is distributed without any warranty that it is
20 # free of the rightful claim of any third person regarding infringement
21 # or the like.  Any license provided herein, whether implied or
22 # otherwise, applies only to this software file.  Patent licenses, if
23 # any, provided herein do not apply to combinations of this program with
24 # other software, or any other product whatsoever.
25
26 # You should have received a copy of the GNU General Public License along
27 # with this program; if not, write the Free Software Foundation, Inc., 59
28 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
29
30 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
31 # Mountain View, CA  94043, or:
32
33 # http://www.sgi.com 
34
35 # For further information regarding this notice, see: 
36
37 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
38 #-----------------------------------------------------------------------
39 #
40 set +x
41 # creator
42 owner=ajag@melbourne.sgi.com
43
44 seq=`basename $0`
45 echo "QA output created by $seq"
46
47 here=`pwd`
48 tmp=/tmp/$$
49 status=1        # failure is the default!
50
51 _cleanup()
52 {
53     umount $SCRATCH_MNT
54     rm -f $tmp.*
55 }
56 trap "_cleanup ; exit \$status" 0 1 2 3 15
57
58 # get standard environment, filters and checks
59 . ./common.rc
60 . ./common.filter
61
62 # real QA test starts here
63
64 _require_scratch
65
66 _do()
67 {
68     if [ $# -ne 1 ]; then echo "Usage: _do \"cmd\"" 1>&2 ; exit 1; fi
69     echo "*** $1" >>$seq.full
70     eval "$1 2>&1 | _fix_malloc >>$seq.full"
71 }
72
73 _fill()
74 {
75     if [ $# -ne 1 ]; then echo "Usage: _fill \"path\"" 1>&2 ; exit 1; fi
76     echo -n "Fill filesystem... "
77     _do "(src/fill2fs --verbose --dir=$1 --seed=0 --filesize=65536 --stddev=32768 --list=- >>$tmp.manifest)"
78     echo "done"
79 }
80
81 rm -f $seq.full
82 #agsize=16
83 agsize=32
84 echo -n "Make $agsize megabyte filesystem on SCRATCH_DEV and mount... "
85 _do "mkfs -t xfs -d size=${agsize}m,agcount=1 -l internal -f $SCRATCH_DEV"
86 _do "mount -t xfs $SCRATCH_DEV $SCRATCH_MNT"
87 echo "done"
88
89 # full allocation group -> partial; partial -> expand partial + new partial;
90 # partial -> expand partial; partial -> full
91 # 17 -> 33 -> 35 -> 48 megabytes, converted to fs blocks below
92 #for size in 4352 8448 8960 12288
93 # 33 -> 67 -> 75 -> 96 converted to fs blocks:
94 for size in 8448 17512 19200 24576
95 do
96     _fill $SCRATCH_MNT/fill_$size
97     echo -n "Grow filesystem to $size blocks... "
98     _do "xfs_growfs -D ${size} $SCRATCH_MNT"
99     echo "done"
100     echo -n "Flush filesystem... "
101     _do "umount $SCRATCH_MNT"
102     _do "mount -t xfs $SCRATCH_DEV $SCRATCH_MNT"
103     echo "done"
104     echo -n "Check files... "
105     if ! _do "src/fill2fs_check $tmp.manifest"; then
106         echo "fail"
107         echo "Files corrupt/missing after growfs. Test failed see $seq.full"
108         status=1; exit
109     fi
110     echo "done"
111 #    echo -n "Checking filesystem... "
112 #    _check_fs $SCRATCH_DEV
113 #    echo "done"
114 done
115
116 # success, all done
117 echo "Growfs tests passed."
118 status=0 ; exit