7 #-----------------------------------------------------------------------
8 # Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
10 # This program is free software; you can redistribute it and/or modify it
11 # under the terms of version 2 of the GNU General Public License as
12 # published by the Free Software Foundation.
14 # This program is distributed in the hope that it would be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 # Further, this software is distributed without any warranty that it is
19 # free of the rightful claim of any third person regarding infringement
20 # or the like. Any license provided herein, whether implied or
21 # otherwise, applies only to this software file. Patent licenses, if
22 # any, provided herein do not apply to combinations of this program with
23 # other software, or any other product whatsoever.
25 # You should have received a copy of the GNU General Public License along
26 # with this program; if not, write the Free Software Foundation, Inc., 59
27 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
29 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
30 # Mountain View, CA 94043, or:
34 # For further information regarding this notice, see:
36 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
37 #-----------------------------------------------------------------------
43 echo "QA output created by $seq"
47 status=0 # success is the default!
49 # 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
69 _full "clean_log : xfs_logprint"
70 xfs_logprint -t $1 | tee -a $seq.full \
71 | head | grep -q "<CLEAN>" || _fail "DIRTY LOG"
77 s/data device: 0x[0-9a-f][0-9a-f]*/data device: <DEVICE>/;
78 s/log device: 0x[0-9a-f][0-9a-f]*/log device: <DEVICE>/;
79 s/daddr: [0-9][0-9]*/daddr: <DADDR>/;
80 s/length: [0-9][0-9]*/length: <LENGTH>/;
81 s/length: [0-9][0-9]*/length: <LENGTH>/;
82 s/^cycle num overwrites: .*$/cycle num overwrites: <TIDS>/;
83 s/tid: [0-9a-f][0-9a-f]*/tid: <TID>/;
84 s/tid:0x[0-9a-f][0-9a-f]*/tid:<TID>/;
85 s/q:0x[0-9a-f][0-9a-f]*/q:<Q>/;
86 s/a:0x[0-9a-f][0-9a-f]*/a:<A>/g;
87 s/blkno:0x[0-9a-f][0-9a-f]*/blkno:<BLKNO>/g;
88 s/blkno: [0-9][0-9]* (0x[0-9a-f]*)/blkno: <BLKNO> (<BLKNO>)/g;
89 s/blkno: [0-9][0-9]*/blkno: <BLKNO>/g;
90 s/boff: [0-9][0-9]*/boff: <BOFF>/g;
91 s/len: *[0-9][0-9]*/len:<LEN>/g;
92 s/skipped [0-9][0-9]* zeroed blocks/skipped <COUNT> zeroed blocks/;
93 s/atime:[0-9a-fx]* *mtime:[0-9a-fx]* *ctime:[0-9a-fx]*/atime:<TIME> mtime:<TIME> ctime:<TIME>/;
94 s/atime 0x[0-9a-f]* mtime 0x[0-9a-f]* ctime 0x[0-9a-f]*/atime <TIME> mtime <TIME> ctime <TIME>/;
95 s/block [0-9][0-9]*/block <BLOCK>/;
96 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>/;
97 s/sunit: *[0-9][0-9]* *swidth: *[0-9][0-9]*/sunit:<SUNIT> swidth:<SWIDTH>/;
98 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>/;
99 s/^uuid: *[0-9a-f-][0-9a-f-]* *format: *.*$/uuid: <UUID> format: <FORMAT>/;
106 _clean_log $SCRATCH_DEV
107 echo "### xfs_logprint output ###"
108 xfs_logprint $SCRATCH_DEV 2>&1 | _filter_logprint
109 echo "### xfs_logprint -t -i -s 0 output ###"
110 xfs_logprint -t -i -s 0 $SCRATCH_DEV 2>&1 | _filter_logprint
111 echo "### xfs_logprint -t -b -s 0 output ###"
112 xfs_logprint -t -b -s 0 $SCRATCH_DEV 2>&1 | _filter_logprint
115 # real QA test starts here
121 rm -f $seq.out $seq.full
122 umount $SCRATCH_DEV >/dev/null 2>&1
125 mkfs_xfs -f -lsize=2000b $SCRATCH_DEV >>$seq.full 2>&1 \
126 || _fail "mkfs failed"
128 mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full 2>&1 \
129 || _fail "mount failed"
133 # generate some log traffic - but not too much - life gets a little
134 # more complicated if the log wraps around. This traffic is
135 # pretty much arbitary, but could probably be made better than this.
137 touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
140 umount $SCRATCH_DEV >>$seq.full 2>&1 \
141 || _fail "umount failed"