Rework test 018 slightly so that its more user friendly when it fails

This commit is contained in:
fsgqa
2003-08-29 00:40:24 +00:00
parent 56dc8d9b3a
commit f1f2a8713d
6 changed files with 56 additions and 48 deletions
+46 -12
View File
@@ -92,29 +92,56 @@ _filter_logprint()
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>/; 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>/;
s/^uuid: *[0-9a-f-][0-9a-f-]* *format: *.*$/uuid: <UUID> format: <FORMAT>/; s/^uuid: *[0-9a-f-][0-9a-f-]* *format: *.*$/uuid: <UUID> format: <FORMAT>/;
/flushiter:/d; /flushiter:/d;
' ' | _fix_malloc
} }
_check_log() _setup_log()
{ {
rm -f $seq.log
_full "clean_log : xfs_logprint" _full "clean_log : xfs_logprint"
_scratch_xfs_logprint -t | tee -a $seq.full \ _scratch_xfs_logprint -t | tee -a $seq.full \
| head | grep -q "<CLEAN>" || _fail "DIRTY LOG" | head | grep -q "<CLEAN>" || _fail "DIRTY LOG"
echo "### xfs_logprint output ###"
_scratch_xfs_logprint 2>&1 | _filter_logprint echo "### xfs_logprint output ###" >>$seq.log
echo "### xfs_logprint -t -i -s 0 output ###" _scratch_xfs_logprint 2>&1 | _filter_logprint >>$seq.log
_scratch_xfs_logprint -t -i -s 0 2>&1 | _filter_logprint echo "### xfs_logprint -t -i -s 0 output ###" >>$seq.log
echo "### xfs_logprint -t -b -s 0 output ###" _scratch_xfs_logprint -t -i -s 0 2>&1 | _filter_logprint >>$seq.log
_scratch_xfs_logprint -t -b -s 0 2>&1 | _filter_logprint echo "### xfs_logprint -t -b -s 0 output ###" >>$seq.log
_scratch_xfs_logprint -t -b -s 0 2>&1 | _filter_logprint >>$seq.log
echo $seq.log
} }
# find the comparison file, depending on which form of quota is
# enabled as this often influences how the test output appears.
# [NB: SCRATCH_DEV must be mounted for this to work]
#
_setup_log_out()
{
if src/feature -U $SCRATCH_DEV
then
if src/feature -G $SCRATCH_DEV
then
echo $seq.ugquota
else
echo $seq.usrquota
fi
elif src/feature -G $SCRATCH_DEV
then
echo $seq.grpquota
else
echo $seq.noquota
fi
}
# real QA test starts here # real QA test starts here
_require_scratch _require_scratch
echo "*** init FS" echo "*** init FS"
touch $seq.out
umount $SCRATCH_DEV >/dev/null 2>&1 umount $SCRATCH_DEV >/dev/null 2>&1
_full "mkfs" _full "mkfs"
@@ -131,13 +158,13 @@ source $tmp.mkfs
[ $lversion -eq 1 ] \ [ $lversion -eq 1 ] \
|| _notrun "Logprint test, tailored to v1 log format (v$lversion in use)" || _notrun "Logprint test, tailored to v1 log format (v$lversion in use)"
rm -f $seq.out $seq.full rm -f $seq.log $seq.full
_full " mount" _full " mount"
_scratch_mount >>$seq.full 2>&1 \ _scratch_mount >>$seq.full 2>&1 \
|| _fail "mount failed" || _fail "mount failed"
_setup_seq_out base=`_setup_log_out`
# generate some log traffic - but not too much - life gets a little # generate some log traffic - but not too much - life gets a little
# more complicated if the log wraps around. This traffic is # more complicated if the log wraps around. This traffic is
@@ -149,7 +176,14 @@ _full "umount"
umount $SCRATCH_DEV >>$seq.full 2>&1 \ umount $SCRATCH_DEV >>$seq.full 2>&1 \
|| _fail "umount failed" || _fail "umount failed"
_check_log mine=`_setup_log`
echo "*** compare logprint"
if ! diff $mine $base >/dev/null; then
echo "FAILED: logprint output $mine differs to $base"
exit 1
fi
rm $seq.full rm $seq.full
exit exit
-9
View File
@@ -1,11 +1,3 @@
QA output created by 018
*** init FS
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
data = bsize=XXX blocks=XXX, imaxpct=PCT
= sunit=XXX swidth=XXX, unwritten=X
naming =VERN bsize=XXX
log =LDEV bsize=XXX blocks=XXX
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
### xfs_logprint output ### ### xfs_logprint output ###
xfs_logprint: xfs_logprint:
data device: <DEVICE> data device: <DEVICE>
@@ -13544,4 +13536,3 @@ DQ : cnt:2 total:2 a:<A> len:<LEN> a:<A> len:<LEN>
DQUOT: #regs:2 blkno:96 boffset:0 id: 0 DQUOT: #regs:2 blkno:96 boffset:0 id: 0
LOG REC AT LSN cycle 1 block <BLOCK> (0x1, 0x236) LOG REC AT LSN cycle 1 block <BLOCK> (0x1, 0x236)
*** unmount
-9
View File
@@ -1,11 +1,3 @@
QA output created by 018
*** init FS
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
data = bsize=XXX blocks=XXX, imaxpct=PCT
= sunit=XXX swidth=XXX, unwritten=X
naming =VERN bsize=XXX
log =LDEV bsize=XXX blocks=XXX
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
### xfs_logprint output ### ### xfs_logprint output ###
xfs_logprint: xfs_logprint:
data device: <DEVICE> data device: <DEVICE>
@@ -12506,4 +12498,3 @@ BUF: cnt:2 total:2 a:<A> len:<LEN> a:<A> len:<LEN>
sunit:<SUNIT> swidth:<SWIDTH> sunit:<SUNIT> swidth:<SWIDTH>
LOG REC AT LSN cycle 1 block <BLOCK> (0x1, 0x1f0) LOG REC AT LSN cycle 1 block <BLOCK> (0x1, 0x1f0)
*** unmount
+10
View File
@@ -0,0 +1,10 @@
QA output created by 018
*** init FS
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
data = bsize=XXX blocks=XXX, imaxpct=PCT
= sunit=XXX swidth=XXX, unwritten=X
naming =VERN bsize=XXX
log =LDEV bsize=XXX blocks=XXX
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
*** compare logprint
*** unmount
-9
View File
@@ -1,11 +1,3 @@
QA output created by 018
*** init FS
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
data = bsize=XXX blocks=XXX, imaxpct=PCT
= sunit=XXX swidth=XXX, unwritten=X
naming =VERN bsize=XXX
log =LDEV bsize=XXX blocks=XXX
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
### xfs_logprint output ### ### xfs_logprint output ###
xfs_logprint: xfs_logprint:
data device: <DEVICE> data device: <DEVICE>
@@ -14647,4 +14639,3 @@ DQ : cnt:2 total:2 a:<A> len:<LEN> a:<A> len:<LEN>
DQUOT: #regs:2 blkno:104 boffset:0 id: 0 DQUOT: #regs:2 blkno:104 boffset:0 id: 0
LOG REC AT LSN cycle 1 block <BLOCK> (0x1, 0x260) LOG REC AT LSN cycle 1 block <BLOCK> (0x1, 0x260)
*** unmount
-9
View File
@@ -1,11 +1,3 @@
QA output created by 018
*** init FS
meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
data = bsize=XXX blocks=XXX, imaxpct=PCT
= sunit=XXX swidth=XXX, unwritten=X
naming =VERN bsize=XXX
log =LDEV bsize=XXX blocks=XXX
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
### xfs_logprint output ### ### xfs_logprint output ###
xfs_logprint: xfs_logprint:
data device: <DEVICE> data device: <DEVICE>
@@ -13544,4 +13536,3 @@ DQ : cnt:2 total:2 a:<A> len:<LEN> a:<A> len:<LEN>
DQUOT: #regs:2 blkno:96 boffset:0 id: 0 DQUOT: #regs:2 blkno:96 boffset:0 id: 0
LOG REC AT LSN cycle 1 block <BLOCK> (0x1, 0x236) LOG REC AT LSN cycle 1 block <BLOCK> (0x1, 0x236)
*** unmount