4 # To test log replay with version 2 logs
5 # Initially keep this simple with just creates.
6 # In another qa test we can do more e.g. use fsstress.
8 #-----------------------------------------------------------------------
9 # Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License as
13 # published by the Free Software Foundation.
15 # This program is distributed in the hope that it would be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write the Free Software Foundation,
22 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #-----------------------------------------------------------------------
28 echo "QA output created by $seq"
32 status=1 # failure is the default!
33 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
35 # get standard environment, filters and checks
40 # real QA test starts here
42 _supported_os IRIX Linux
44 rm -f $seq.full $tmp.*
49 umount $SCRATCH_DEV >/dev/null 2>&1
51 cat >$tmp.seq.params <<EOF
53 # ------------------------------
54 version=2 logbsize=32k
55 version=2,su=4096 logbsize=32k
56 version=2,su=32768 logbsize=32k
57 version=2,su=32768 logbsize=64k
58 version=2 logbsize=64k
59 version=2,su=64k logbsize=64k
60 version=2 logbsize=128k
61 version=2,su=128k logbsize=128k
62 version=2 logbsize=256k
63 version=2,su=256k logbsize=256k
66 # Do the work for various log params which
67 # should not effect the data content of the log
68 # Try with and without sync'ing - sync'ing will mean that
69 # the log will be written out unfilled and thus the log
70 # stripe can have an effect.
72 for s in sync nosync ; do
74 | while read mkfs mnt restofline
76 if [ "$mkfs" = "#" ]; then
80 echo "--- mkfs=$mkfs, mnt=$mnt, sync=$s ---"
81 export MKFS_OPTIONS="-l $mkfs"
82 export MOUNT_OPTIONS="-o $mnt"
86 _scratch_mkfs_xfs >>$seq.full 2>&1
87 if [ $? -ne 0 ] ; then
88 _echofull "mkfs failed: $MKFS_OPTIONS"
94 if ! _scratch_mount >>$seq.full 2>&1; then
95 _echofull "mount failed: $MOUNT_OPTIONS"
100 if [ $s = "sync" ]; then
101 # generate some log traffic - but not too much
102 # add some syncs to get the log flushed to disk
103 for file in $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}; do
108 # generate some log traffic - but not too much - life gets a little
109 # more complicated if the log wraps around. This traffic is
110 # pretty much arbitary, but could probably be made better than this.
111 touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
114 # check before on what FS should look like
115 _echofull "ls SCRATCH_MNT"
119 src/godown -v -f $SCRATCH_MNT >> $seq.full
122 umount $SCRATCH_DEV >>$seq.full 2>&1 \
123 || _fail "umount failed"
125 _echofull "logprint after going down..."
128 _echofull "mount with replay"
129 _scratch_mount >>$seq.full 2>&1 \
130 || _fail "mount failed: $MOUNT_OPTIONS"
132 # check on what FS looks like after log recovery
133 _echofull "ls SCRATCH_MNT"
139 _echofull "logprint after mount and replay..."
142 if _check_scratch_fs; then
143 _echofull "filesystem is checked ok"
145 _echofull "filesystem is NOT ok"