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