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 _scratch_mkfs >/dev/null 2>&1
54 _require_metadata_journaling $SCRATCH_DEV
56 _get_log_configs > $tmp.seq.params
58 # Do the work for various log params which
59 # should not effect the data content of the log
60 # Try with and without sync'ing - sync'ing will mean that
61 # the log will be written out unfilled and thus the log
62 # stripe can have an effect.
64 for s in sync nosync ; do
66 | while read mkfs mnt restofline
68 if [ "$mkfs" = "#" ]; then
72 echo "--- mkfs=$mkfs, mnt=$mnt, sync=$s ---" >>$seqres.full
73 export MKFS_OPTIONS="-l $mkfs"
74 export MOUNT_OPTIONS="-o $mnt"
78 _scratch_mkfs >>$seqres.full 2>&1
79 if [ $? -ne 0 ] ; then
80 _echofull "mkfs failed: $MKFS_OPTIONS"
86 if ! _scratch_mount >>$seqres.full 2>&1; then
87 _echofull "mount failed: $MOUNT_OPTIONS"
92 if [ $s = "sync" ]; then
93 # generate some log traffic - but not too much
94 # add some syncs to get the log flushed to disk
95 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
100 # generate some log traffic - but not too much - life gets a little
101 # more complicated if the log wraps around. This traffic is
102 # pretty much arbitary, but could probably be made better than this.
103 touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
106 # check before on what FS should look like
107 _echofull "ls SCRATCH_MNT"
108 ls $SCRATCH_MNT | _filter_lostfound
111 src/godown -v -f $SCRATCH_MNT >> $seqres.full
114 _scratch_unmount >>$seqres.full 2>&1 \
115 || _fail "umount failed"
117 _echofull "logprint after going down..."
120 _echofull "mount with replay"
121 _scratch_mount >>$seqres.full 2>&1 \
122 || _fail "mount failed: $MOUNT_OPTIONS"
124 # check on what FS looks like after log recovery
125 _echofull "ls SCRATCH_MNT"
126 ls $SCRATCH_MNT | _filter_lostfound
131 _echofull "logprint after mount and replay..."
134 if _check_scratch_fs; then
135 _echofull "filesystem is checked ok"
137 _echofull "filesystem is NOT ok"