5e5e889af18fc69a439f2e46450824042a97419f
[xfstests-dev.git] / 018
1 #! /bin/sh
2 #
3 #-----------------------------------------------------------------------
4 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
5 #
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
9 #
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 #
19 #-----------------------------------------------------------------------
20 #
21 # FS QA Test No. 018
22 #
23 # xfs_logprint test - test v2 logs of different LR sizes
24 #
25 # creator
26 owner=tes@sgi.com
27
28 seq=`basename $0`
29 echo "QA output created by $seq"
30
31 here=`pwd`
32 tmp=/tmp/$$
33 status=1        # failure is the default!
34
35 # get standard environment, filters and checks
36 . ./common.rc
37 . ./common.filter
38 . ./common.log
39
40 _cleanup()
41 {
42     cd /
43     _cleanup_logfiles
44     rm -f $tmp.*
45     umount $SCRATCH_MNT 2>/dev/null
46 }
47 trap "_cleanup; exit \$status" 0 1 2 3 15
48
49 # real QA test starts here
50 _supported_fs xfs
51 _supported_os IRIX Linux
52 # prelim
53 rm -f $seq.full $tmp.*
54 _require_scratch
55 _require_v2log
56
57 # link correct .out file
58 _link_out_file $seq.op
59
60
61 echo "*** init FS"
62 umount $SCRATCH_DEV >/dev/null 2>&1
63
64 cat >$tmp.seq.params <<EOF
65 # mkfs-opt        mount-opt
66   version=1     logbsize=32k
67   version=2     logbsize=32k
68   version=2     logbsize=64k
69   version=2     logbsize=128k
70   version=2     logbsize=256k
71 EOF
72
73 if [ "$HOSTOS" = "IRIX" ]; then
74     start_blk=0
75 else
76     start_blk=2
77 fi
78
79 # do the work for various log params which
80 # should not effect the data content of the log
81 cat $tmp.seq.params \
82 | while read mkfs mnt
83 do
84     if [ "$mkfs" = "#" ]; then
85         continue
86     fi
87     export MOUNT_OPTIONS="-o noalign,$mnt"
88     _mkfs_log "-l $mkfs"
89     _create_log
90     _check_log
91
92     _print_operation
93     _cmp_op_output $seq.op $filtered
94
95     _print_transaction_inode $start_blk
96     _cmp_output $seq.trans_inode $filtered
97
98     _print_transaction_buf $start_blk
99     _cmp_output $seq.trans_buf $filtered
100 done
101
102 # got thru it all so we may have success
103 status=0
104
105 exit