From: fsgqa Date: Fri, 29 Aug 2003 00:40:24 +0000 (+0000) Subject: Rework test 018 slightly so that its more user friendly when it fails X-Git-Tag: v1.1.0~932 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f1f2a8713d52a6d230b8a8e598d510e5c6770b61;p=users%2Fhch%2Fxfstests-dev.git Rework test 018 slightly so that its more user friendly when it fails --- diff --git a/018 b/018 index 42815baa7..5c09592ed 100755 --- a/018 +++ b/018 @@ -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: last: cnt: freeblks: longest:/; s/^uuid: *[0-9a-f-][0-9a-f-]* *format: *.*$/uuid: format: /; /flushiter:/d; - ' + ' | _fix_malloc } -_check_log() +_setup_log() { + rm -f $seq.log _full "clean_log : xfs_logprint" + _scratch_xfs_logprint -t | tee -a $seq.full \ | head | grep -q "" || _fail "DIRTY LOG" - echo "### xfs_logprint output ###" - _scratch_xfs_logprint 2>&1 | _filter_logprint - echo "### xfs_logprint -t -i -s 0 output ###" - _scratch_xfs_logprint -t -i -s 0 2>&1 | _filter_logprint - echo "### xfs_logprint -t -b -s 0 output ###" - _scratch_xfs_logprint -t -b -s 0 2>&1 | _filter_logprint + + echo "### xfs_logprint output ###" >>$seq.log + _scratch_xfs_logprint 2>&1 | _filter_logprint >>$seq.log + echo "### xfs_logprint -t -i -s 0 output ###" >>$seq.log + _scratch_xfs_logprint -t -i -s 0 2>&1 | _filter_logprint >>$seq.log + 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 _require_scratch echo "*** init FS" -touch $seq.out umount $SCRATCH_DEV >/dev/null 2>&1 _full "mkfs" @@ -131,13 +158,13 @@ source $tmp.mkfs [ $lversion -eq 1 ] \ || _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" _scratch_mount >>$seq.full 2>&1 \ || _fail "mount failed" -_setup_seq_out +base=`_setup_log_out` # generate some log traffic - but not too much - life gets a little # more complicated if the log wraps around. This traffic is @@ -149,7 +176,14 @@ _full "umount" umount $SCRATCH_DEV >>$seq.full 2>&1 \ || _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 exit diff --git a/018.grpquota b/018.grpquota index 82ba340df..fd30fd39c 100755 --- a/018.grpquota +++ b/018.grpquota @@ -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: data device: @@ -13544,4 +13536,3 @@ DQ : cnt:2 total:2 a: len: a: len: DQUOT: #regs:2 blkno:96 boffset:0 id: 0 LOG REC AT LSN cycle 1 block (0x1, 0x236) -*** unmount diff --git a/018.noquota b/018.noquota index 5f433ea77..d1d6934ae 100755 --- a/018.noquota +++ b/018.noquota @@ -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: data device: @@ -12506,4 +12498,3 @@ BUF: cnt:2 total:2 a: len: a: len: sunit: swidth: LOG REC AT LSN cycle 1 block (0x1, 0x1f0) -*** unmount diff --git a/018.out b/018.out new file mode 100644 index 000000000..4674d8a34 --- /dev/null +++ b/018.out @@ -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 diff --git a/018.ugquota b/018.ugquota index 39b406e29..d42ac603a 100755 --- a/018.ugquota +++ b/018.ugquota @@ -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: data device: @@ -14647,4 +14639,3 @@ DQ : cnt:2 total:2 a: len: a: len: DQUOT: #regs:2 blkno:104 boffset:0 id: 0 LOG REC AT LSN cycle 1 block (0x1, 0x260) -*** unmount diff --git a/018.usrquota b/018.usrquota index d0fe8c969..c88a31444 100755 --- a/018.usrquota +++ b/018.usrquota @@ -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: data device: @@ -13544,4 +13536,3 @@ DQ : cnt:2 total:2 a: len: a: len: DQUOT: #regs:2 blkno:96 boffset:0 id: 0 LOG REC AT LSN cycle 1 block (0x1, 0x236) -*** unmount