xfs/096: filter out the "Discarding..." output
[xfstests-dev.git] / tests / xfs / 096
index d06bd59b190f0b740902eacece0a46946b7fb022..04bc7b7dfdaae91e1ca97552555ceddc1eb12e7d 100755 (executable)
@@ -1,29 +1,15 @@
 #! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
+#
 # FS QA Test No. 096
 #
 # test out mkfs_xfs output on IRIX/Linux and some of its error handling
 # ensure pv#920679 is addressed
 #
-#-----------------------------------------------------------------------
-# Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-#-----------------------------------------------------------------------
-#
-
+seqfull=$0
 seq=`basename $0`
+seqres=$RESULT_DIR/$seq
 echo "QA output created by $seq"
 
 here=`pwd`
@@ -38,13 +24,15 @@ _cleanup()
 }
 
 # get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-. ./common.log
+. ./common/rc
+. ./common/filter
+. ./common/log
 
 #
 # filter out counts which will vary
 #   - extsz, blocks, agsize, agcount, device name, rtextents
+#   - log version varies for crc enabled fs
+#   - lsunit varies for 512/4k sector devices
 # filter out differences between linux and irix:
 #   - sectsz on Linux
 #   - mmr, mixed-case on IRIX
@@ -61,9 +49,9 @@ _cleanup()
 #           =                       sunit=0 blks
 #  realtime =none                   extsz=65536  blocks=N, rtextents=N
 #
-_mkfs_filter()
+mkfs_filter()
 {
-   tee -a $seq.full | \
+   tee -a $seqres.full | \
    sed \
        -e 's/extsz=[0-9][0-9]*[ ]*/extsz=N, /' \
        -e 's/blocks=[0-9][0-9]*/blocks=N/' \
@@ -73,11 +61,13 @@ _mkfs_filter()
         -e 's/swidth=[0-9][0-9]* blks$/&, unwritten=1/' \
        -e 's/rtextents=[0-9][0-9]*/rtextents=N/' \
        -e 's/meta-data=[^ ]*/meta-data=DEV/' \
-        -e 's/ *isize/ isize/' \
+        -e 's/ *isize=[0-9]* / isize=N /' \
        -e '/ *= *sectsz=[0-9][0-9]* *attr=[0-9][0-9]*.*$/d' \
        -e '/ *= *mmr=[0-9][0-9]* *$/d' \
        -e 's/ *mixed-case=[YN]//' \
        -e 's/ *ascii-ci=[01]//' \
+       -e 's/\(version=\)\([12]\)/\1N/' \
+       -e 's/\(sunit=\)\([018] blks\)/\1N blks/' \
        -e 's/sectsz=[0-9][0-9]* *//' \
        -e 's/, lazy-count.*//' \
        -e '/inode-paths/d' \
@@ -85,24 +75,29 @@ _mkfs_filter()
        -e 's/\(realtime[       ]*=\).*extsz/\1REALTIME               extsz/' \
        -e '/.*crc=/d' \
        -e 's/ *$//' \
+       -e 's/ ftype=[01]//' \
+       -e '/^log stripe unit.*too large/d' \
+       -e '/^log stripe unit adjusted/d' \
+       -e '/Discarding/d' \
    | grep -v parent
 }
 
 # real QA test starts here
-rm -f $seq.full
+rm -f $seqres.full
 
 # Modify as appropriate.
 _supported_fs xfs
-_supported_os IRIX Linux
+_supported_os Linux
 _require_scratch
 _require_v2log
+_require_xfs_mkfs_without_validation
 
 # choose .out file based on internal/external log
-rm -f $seq.out
+rm -f $seqfull.out
 if [ "$USE_EXTERNAL" = yes ]; then
-       ln -s $seq.external $seq.out
+       ln -s $seq.out.external $seqfull.out
 else
-       ln -s $seq.internal $seq.out
+       ln -s $seq.out.internal $seqfull.out
 fi
 
 # maximum log record size
@@ -121,12 +116,11 @@ cat >$tmp.seq.params <<EOF
 # same test but get log stripe from data stripe
   -l version=2 -d su=$big_su,sw=1
 # test out data stripe
-  -l version=1 -d su=$big_su,sw=1
+  -m crc=0 -l version=1 -d su=$big_su,sw=1
 # test out data stripe the same but using sunit & swidth
-  -l version=1 -d sunit=`expr $big_su / 512`,swidth=`expr $big_su / 512`
+  -m crc=0 -l version=1 -d sunit=`expr $big_su / 512`,swidth=`expr $big_su / 512`
 EOF
 
-
 #
 # call mkfs in a loop for various params
 #
@@ -141,7 +135,7 @@ do
     fi
     echo "--- mkfs=$mkfs ---"
     export MKFS_OPTIONS="$mkfs"
-    _scratch_mkfs_xfs | _mkfs_filter
+    _scratch_mkfs_xfs 2>&1 | mkfs_filter
     echo ""
     echo ""
 done