tests: remove IRIX support from tests also supported on Linux
[xfstests-dev.git] / tests / xfs / 041
1 #! /bin/bash
2 # FS QA Test No. 041
3 #
4 # growfs QA tests - repeatedly fill/grow the filesystem
5 # check the filesystem contents after each operation
6 #
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
9 #
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
13 #
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22 #
23 #-----------------------------------------------------------------------
24 #
25 set +x
26
27 seq=`basename $0`
28 seqres=$RESULT_DIR/$seq
29 echo "QA output created by $seq"
30
31 here=`pwd`
32 tmp=/tmp/$$
33 status=1        # failure is the default!
34
35 _cleanup()
36 {
37     cd /
38     _scratch_unmount
39     rm -f $tmp.*
40 }
41 trap "_cleanup ; exit \$status" 0 1 2 3 15
42
43 # get standard environment, filters and checks
44 . ./common/rc
45 . ./common/filter
46
47 # real QA test starts here
48 _supported_fs xfs
49 _supported_os Linux
50
51 _require_scratch
52 _require_no_large_scratch_dev
53 _scratch_unmount 2>/dev/null
54
55 _fill()
56 {
57     if [ $# -ne 1 ]; then echo "Usage: _fill \"path\"" 1>&2 ; exit 1; fi
58     _do "Fill filesystem" \
59         "src/fill2fs --verbose --dir=$1 --seed=0 --filesize=65536 --stddev=32768 --list=- >>$tmp.manifest"
60 }
61
62 _do_die_on_error=message_only
63 rm -f $seqres.full
64 agsize=32
65 echo -n "Make $agsize megabyte filesystem on SCRATCH_DEV and mount... "
66 _scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 >/dev/null || _fail "mkfs failed"
67 bsize=`_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 | _filter_mkfs 2>&1 \
68                 | perl -ne 'if (/dbsize=(\d+)/) {print $1;}'`
69 onemeginblocks=`expr 1048576 / $bsize`
70 _scratch_mount || _fail "mount failed"
71
72 echo "done"
73
74 # full allocation group -> partial; partial -> expand partial + new partial;
75 # partial -> expand partial; partial -> full
76 # cycle through 33m -> 67m -> 75m -> 96m
77 for size in 33 67 75 96
78 do
79     grow_size=`expr $size \* $onemeginblocks`
80     _fill $SCRATCH_MNT/fill_$size
81     _do "Grow filesystem to ${size}m" "xfs_growfs -D $grow_size $SCRATCH_MNT"
82     echo -n "Flush filesystem... "
83     _do "_scratch_unmount"
84     _do "_scratch_mount"
85     echo "done"
86     echo -n "Check files... "
87     if ! _do "src/fill2fs_check $tmp.manifest"; then
88       echo "fail (see $seqres.full)"
89       _do "cat $tmp.manifest"
90       _do "ls -altrR $SCRATCH_MNT"
91       _do "dd if=$SCRATCH_DEV bs=4096 count=$grow_size | gzip -9 > $seq.fsimage.gz"
92       status=1 ; exit
93     fi
94     echo "done"
95 done
96
97 # success, all done
98 echo "Growfs tests passed."
99 status=0 ; exit