Rework test 018 slightly so that its more user friendly when it fails
authorfsgqa <fsgqa>
Fri, 29 Aug 2003 00:40:24 +0000 (00:40 +0000)
committerfsgqa <fsgqa>
Fri, 29 Aug 2003 00:40:24 +0000 (00:40 +0000)
018
018.grpquota
018.noquota
018.out [new file with mode: 0644]
018.ugquota
018.usrquota

diff --git a/018 b/018
index 42815baa7fa6d911d32397a77b3c3c996884985f..5c09592ed4b0cdcb2b0fd2a174f1646b50179a72 100755 (executable)
--- 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:<NUM> last:<NUM> cnt:<COUNT> freeblks:<COUNT> longest:<NUM>/;
         s/^uuid: *[0-9a-f-][0-9a-f-]* *format: *.*$/uuid: <UUID> format: <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 "<CLEAN>" || _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
index 82ba340df11ce6d0a96899b8c46889023981d2a2..fd30fd39c1dfe7e4942f298e564cbbed0a09534d 100755 (executable)
@@ -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: <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
 
 LOG REC AT LSN cycle 1 block <BLOCK> (0x1, 0x236)
-*** unmount
index 5f433ea772d35fc2cb2932edfd6a5edc7e2b1f45..d1d6934aefed72691893fdc30a66ef46c5dc62f5 100755 (executable)
@@ -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: <DEVICE>
@@ -12506,4 +12498,3 @@ BUF: cnt:2 total:2 a:<A> len:<LEN> a:<A> len:<LEN>
                sunit:<SUNIT> swidth:<SWIDTH>
 
 LOG REC AT LSN cycle 1 block <BLOCK> (0x1, 0x1f0)
-*** unmount
diff --git a/018.out b/018.out
new file mode 100644 (file)
index 0000000..4674d8a
--- /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
index 39b406e29270021021a41b6de7f5549c039591d9..d42ac603afab9cb69c8a11a6eaadf0017bb3a5a8 100755 (executable)
@@ -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: <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
 
 LOG REC AT LSN cycle 1 block <BLOCK> (0x1, 0x260)
-*** unmount
index d0fe8c96969c382c5d6244ce996bdf58d6dd3bda..c88a314445126a1864e172afda8aad57814955d0 100755 (executable)
@@ -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: <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
 
 LOG REC AT LSN cycle 1 block <BLOCK> (0x1, 0x236)
-*** unmount