6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
9 # This program is free software; you can redistribute it and/or modify it
10 # under the terms of version 2 of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 # Further, this software is distributed without any warranty that it is
18 # free of the rightful claim of any third person regarding infringement
19 # or the like. Any license provided herein, whether implied or
20 # otherwise, applies only to this software file. Patent licenses, if
21 # any, provided herein do not apply to combinations of this program with
22 # other software, or any other product whatsoever.
24 # You should have received a copy of the GNU General Public License along
25 # with this program; if not, write the Free Software Foundation, Inc., 59
26 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
28 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
29 # Mountain View, CA 94043, or:
33 # For further information regarding this notice, see:
35 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
36 #-----------------------------------------------------------------------
42 echo "QA output created by $seq"
46 status=0 # success is the default!
48 # get standard environment, filters and checks
56 umount $SCRATCH_MNT 2>/dev/null
58 trap "_cleanup; exit \$status" 0 1 2 3 15
63 echo "*** $* ***" >>$seq.full
70 s/data device: 0x[0-9a-f][0-9a-f]*/data device: <DEVICE>/;
71 s/log device: 0x[0-9a-f][0-9a-f]*/log device: <DEVICE>/;
72 s/log file: \".*\"/log device: <DEVICE>/;
73 s/daddr: [0-9][0-9]*/daddr: <DADDR>/;
74 s/length: [0-9][0-9]*/length: <LENGTH>/;
75 s/length: [0-9][0-9]*/length: <LENGTH>/;
76 s/^cycle num overwrites: .*$/cycle num overwrites: <TIDS>/;
77 s/tid: [0-9a-f][0-9a-f]*/tid: <TID>/;
78 s/tid:0x[0-9a-f][0-9a-f]*/tid:<TID>/;
79 s/q:0x[0-9a-f][0-9a-f]*/q:<Q>/;
80 s/a:0x[0-9a-f][0-9a-f]*/a:<A>/g;
81 s/blkno:0x[0-9a-f][0-9a-f]*/blkno:<BLKNO>/g;
82 s/blkno: [0-9][0-9]* (0x[0-9a-f]*)/blkno: <BLKNO> (<BLKNO>)/g;
83 s/blkno: [0-9][0-9]*/blkno: <BLKNO>/g;
84 s/boff: [0-9][0-9]*/boff: <BOFF>/g;
85 s/len: *[0-9][0-9]*/len:<LEN>/g;
86 s/skipped [0-9][0-9]* zeroed blocks/skipped <COUNT> zeroed blocks/;
87 s/atime:[0-9a-fx]* *mtime:[0-9a-fx]* *ctime:[0-9a-fx]*/atime:<TIME> mtime:<TIME> ctime:<TIME>/;
88 s/atime 0x[0-9a-f]* mtime 0x[0-9a-f]* ctime 0x[0-9a-f]*/atime <TIME> mtime <TIME> ctime <TIME>/;
89 s/block [0-9][0-9]*/block <BLOCK>/;
90 s/icount: *[0-9][0-9]* *ifree: *[0-9][0-9]* *fdblks: *[0-9][0-9]* *frext: *[0-9][0-9]*/icount:<COUNT> ifree:<FREE> fdblks:<BLOCKS> frext:<COUNT>/;
91 s/sunit: *[0-9][0-9]* *swidth: *[0-9][0-9]*/sunit:<SUNIT> swidth:<SWIDTH>/;
92 s/1st: *[0-9][0-9]* *last: *[0-9][0-9]* *cnt: *[0-9][0-9]* *freeblks: *[0-9][0-9]* *longest: *[0-9][0-9]*/1st:<NUM> last:<NUM> cnt:<COUNT> freeblks:<COUNT> longest:<NUM>/;
93 s/^uuid: *[0-9a-f-][0-9a-f-]* *format: *.*$/uuid: <UUID> format: <FORMAT>/;
101 _full "clean_log : xfs_logprint"
103 _scratch_xfs_logprint -t | tee -a $seq.full \
104 | head | grep -q "<CLEAN>" || _fail "DIRTY LOG"
106 echo "### xfs_logprint output ###" >>$seq.log
107 _scratch_xfs_logprint 2>&1 | _filter_logprint >>$seq.log
108 echo "### xfs_logprint -t -i -s 0 output ###" >>$seq.log
109 _scratch_xfs_logprint -t -i -s 0 2>&1 | _filter_logprint >>$seq.log
110 echo "### xfs_logprint -t -b -s 0 output ###" >>$seq.log
111 _scratch_xfs_logprint -t -b -s 0 2>&1 | _filter_logprint >>$seq.log
116 # find the comparison file, depending on which form of quota is
117 # enabled as this often influences how the test output appears.
118 # [NB: SCRATCH_DEV must be mounted for this to work]
122 if src/feature -U $SCRATCH_DEV
124 if src/feature -G $SCRATCH_DEV
130 elif src/feature -G $SCRATCH_DEV
139 # real QA test starts here
145 umount $SCRATCH_DEV >/dev/null 2>&1
149 _scratch_mkfs_xfs -lsize=2000b >$tmp.mkfs0 2>&1
151 _notrun "Cannot mkfs for this test using MKFS_OPTIONS specified"
152 _filter_mkfs <$tmp.mkfs0 2>$tmp.mkfs
154 [ $dbsize -eq 4096 ] \
155 || _notrun "Logprint test, tailored to 4K blocks ($dbsize in use)"
157 || _notrun "Logprint test, tailored to 256b inodes ($isize in use)"
158 [ $lversion -eq 1 ] \
159 || _notrun "Logprint test, tailored to v1 log format (v$lversion in use)"
161 rm -f $seq.log $seq.full
164 _scratch_mount >>$seq.full 2>&1 \
165 || _fail "mount failed"
167 base=`_setup_log_out`
169 # generate some log traffic - but not too much - life gets a little
170 # more complicated if the log wraps around. This traffic is
171 # pretty much arbitary, but could probably be made better than this.
173 touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
176 umount $SCRATCH_DEV >>$seq.full 2>&1 \
177 || _fail "umount failed"
181 echo "*** compare logprint"
183 if ! diff $mine $base >/dev/null; then
184 echo "FAILED: logprint output $mine differs to $base"