Added test for noatime checking
[xfstests-dev.git] / 082
1 #! /bin/sh
2 # FS QA Test No. 082
3 #
4 # Test out the v2 stripe logs with logprint
5 #
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=tes@melbourne.sgi.com
12
13 seq=`basename $0`
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19
20 # get standard environment, filters and checks
21 . ./common.rc
22 . ./common.filter
23 . ./common.log
24
25 _cleanup()
26 {
27     cd /
28     _cleanup_logfiles
29     rm -f $tmp.*
30     umount $SCRATCH_MNT 2>/dev/null
31 }
32 trap "_cleanup; exit \$status" 0 1 2 3 15
33
34 # real QA test starts here
35 _supported_fs xfs
36 _supported_os IRIX Linux
37
38 # prelim
39 rm -f $seq.full $tmp.*
40 _require_scratch
41 _require_v2log 
42
43 # link correct .out file
44 _link_out_file $seq.op
45
46 echo "*** init FS"
47 umount $SCRATCH_DEV >/dev/null 2>&1
48
49 cat >$tmp.seq.params <<EOF
50 # mkfs-opt             mount-opt            start-blk
51   version=2            logbsize=32k       2
52   version=2,su=4096    logbsize=32k       8
53   version=2,su=32768   logbsize=32k       64
54 #
55 # expect following line to fail
56 #
57   version=2,su=36864   logbsize=32k       72
58 #
59 # following is not a power of 2 BBs 
60 #
61   version=2,su=5120    logbsize=32k       10
62 EOF
63
64 # Do the work for various log params which
65 # should not effect the data content of the log
66 # Try with and without sync'ing - sync'ing will mean that
67 # the log will be written out unfilled and thus the log 
68 # stripe can have an effect.
69 #
70 for s in sync nosync ; do
71     cat $tmp.seq.params \
72     | while read mkfs mnt start restofline
73     do
74         if [ "$mkfs" = "#" ]; then 
75             continue
76         fi
77         if [ "$HOSTOS" = "IRIX" ]; then 
78             # don't have umount rec at start on IRIX
79             # so we won't have to skip over it and get to 
80             # another stripe boundary
81             start=0
82         fi
83         echo "--- mkfs=$mkfs, mnt=$mnt, sync=$s ---"
84         export MKFS_OPTIONS="-l $mkfs"
85         export MOUNT_OPTIONS="-o $mnt"
86         if ! _mkfs_log; then
87             continue
88         fi      
89         if [ $s = "sync" ]; then
90             _create_log_sync
91         else
92             _create_log
93         fi
94         if [ $? -ne 0 ]; then
95             continue
96         fi
97         _check_log
98
99         sync_suffix=".$s"
100
101         if [ $s = "sync" ]; then
102             # if sync then we have chance of DATA FORK EXTENTS items
103             # not hanging around very long due to inode syncing to disk
104             # (see comment in xfs_iflush_int())
105             # and this is to hard to reconcile in the op output
106             :
107         else
108             _print_operation
109             _cmp_op_output $seq.op $filtered
110         fi
111
112         _print_transaction_inode $start
113         _cmp_output $seq.trans_inode $filtered
114
115         _print_transaction_buf $start
116         _cmp_output $seq.trans_buf $filtered
117     done
118 done
119
120 status=0
121 exit