QA test 004 updated to stash full mkfs output in .full file for reference
[xfstests-dev.git] / 004
diff --git a/004 b/004
index c401391e28543558ac357973c6b0d83d577db1cc..c1332b14e37443a2af095d18bcf3910c0415cd71 100755 (executable)
--- a/004
+++ b/004
@@ -5,7 +5,7 @@
 # exercise xfs_db bug #789674 and other freesp functionality
 #
 #-----------------------------------------------------------------------
-# Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
+# Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
 # 
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of version 2 of the GNU General Public License as
@@ -56,7 +56,9 @@ trap "_cleanup" 0 1 2 3 15
 
 _populate_scratch()
 {
-       mkfs_xfs -f $SCRATCH_DEV >/dev/null 2>&1
+       echo "=== mkfs output ===" >>$seq.full
+       mkfs_xfs $SCRATCH_DEV | tee -a $seq.full | _filter_mkfs 2>$tmp.mkfs
+       source $tmp.mkfs
        mount -t xfs $SCRATCH_DEV $SCRATCH_MNT
        dd if=/dev/zero of=$SCRATCH_MNT/foo count=200 bs=4096 >/dev/null 2>&1 &
        dd if=/dev/zero of=$SCRATCH_MNT/goo count=400 bs=4096 >/dev/null 2>&1 &
@@ -82,16 +84,7 @@ _populate_scratch
 eval `df -P -T --block-size=512 $SCRATCH_MNT 2>&1 \
        | $AWK_PROG 'END { printf "blocks=%u used=%u avail=%u\n", $3, $4, $5 }'`
 echo "df gave: blocks=$blocks used=$used avail=$avail" >>$seq.full
-
-blksize=`xfs_db -r -c sb -c p $SCRATCH_DEV |grep blocksize |sed -e 's/.*= *//'`
-if [ -z "$blksize" ]
-then
-       echo "Arrgh ... cannot determine blocksize for $fs, xfs_db reports"
-       xfs_db -r -c sb -c p $SCRATCH_DEV
-       status=1
-       continue
-fi
-echo "blocksize from xfs_db is '$blksize'" >>$seq.full
+echo "blocksize from mkfs is '$dbsize'" >>$seq.full
 
 xfs_db -r -c "freesp -s" $SCRATCH_DEV >$tmp.xfs_db
 echo "xfs_db for $SCRATCH_DEV" >>$seq.full
@@ -102,7 +95,7 @@ perl -ne '
            BEGIN       { $avail ='$avail' * 512;
                          $answer="(no xfs_db free blocks line?)" }
            /free blocks (\d+)$/        || next;
-           $freesp = $1 * '$blksize';
+           $freesp = $1 * '$dbsize';
            if ($freesp == $avail)      { $answer = "yes"; }
            else                        { $answer = "no ($freesp != $avail)"; }
            END { print "$answer\n" }