4 # This test verifies that the xfsprogs log formatting infrastructure works
5 # correctly for various log stripe unit values. The log is formatted with xfs_db
6 # and verified with xfs_logprint.
8 #-----------------------------------------------------------------------
9 # Copyright (c) 2015 Red Hat, Inc. All Rights Reserved.
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License as
13 # published by the Free Software Foundation.
15 # This program is distributed in the hope that it would be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write the Free Software Foundation,
22 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #-----------------------------------------------------------------------
27 seqres=$RESULT_DIR/$seq
28 echo "QA output created by $seq"
32 status=1 # failure is the default!
33 trap "_cleanup; exit \$status" 0 1 2 3 15
43 # get standard environment, filters and checks
47 # real QA test starts here
49 # Modify as appropriate.
54 _require_xfs_db_command "logformat"
56 _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
58 # Reformat the log with various log stripe unit sizes and see if logprint dumps
59 # any errors. Use a cycle value larger than 1 so the log is actually written
60 # (the log is zeroed when cycle == 1).
61 for i in 16 32 64 128 256; do
63 _scratch_xfs_db -x -c "logformat -c 3 -s $lsunit" | \
65 # don't redirect error output so it causes test failure
66 $XFS_LOGPRINT_PROG $SCRATCH_DEV >> $seqres.full