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 seqres=$RESULT_DIR/$seq
29 echo "QA output created by $seq"
33 status=1 # failure is the default!
34 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
36 # get standard environment, filters and checks
41 # real QA test starts here
43 _supported_os IRIX Linux
45 rm -f $seqres.full $tmp.*
47 _require_scratch_shutdown
51 _scratch_unmount >/dev/null 2>&1
53 _get_log_configs > $tmp.seq.params
55 # Do the work for various log params which
56 # should not effect the data content of the log
57 # Try with and without sync'ing - sync'ing will mean that
58 # the log will be written out unfilled and thus the log
59 # stripe can have an effect.
61 for s in sync nosync ; do
63 | while read mkfs mnt restofline
65 if [ "$mkfs" = "#" ]; then
69 echo "--- mkfs=$mkfs, mnt=$mnt, sync=$s ---" >>$seqres.full
70 export MKFS_OPTIONS="-l $mkfs"
71 export MOUNT_OPTIONS="-o $mnt"
75 _scratch_mkfs >>$seqres.full 2>&1
76 if [ $? -ne 0 ] ; then
77 _echofull "mkfs failed: $MKFS_OPTIONS"
83 if ! _scratch_mount >>$seqres.full 2>&1; then
84 _echofull "mount failed: $MOUNT_OPTIONS"
89 if [ $s = "sync" ]; then
90 # generate some log traffic - but not too much
91 # add some syncs to get the log flushed to disk
92 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
97 # generate some log traffic - but not too much - life gets a little
98 # more complicated if the log wraps around. This traffic is
99 # pretty much arbitary, but could probably be made better than this.
100 touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
103 # check before on what FS should look like
104 _echofull "ls SCRATCH_MNT"
105 ls $SCRATCH_MNT | _filter_lostfound
108 src/godown -v -f $SCRATCH_MNT >> $seqres.full
111 _scratch_unmount >>$seqres.full 2>&1 \
112 || _fail "umount failed"
114 _echofull "logprint after going down..."
117 _echofull "mount with replay"
118 _scratch_mount >>$seqres.full 2>&1 \
119 || _fail "mount failed: $MOUNT_OPTIONS"
121 # check on what FS looks like after log recovery
122 _echofull "ls SCRATCH_MNT"
123 ls $SCRATCH_MNT | _filter_lostfound
128 _echofull "logprint after mount and replay..."
131 if _check_scratch_fs; then
132 _echofull "filesystem is checked ok"
134 _echofull "filesystem is NOT ok"