xfstests: remove stale machine configs
[xfstests-dev.git] / 087
1 #! /bin/bash
2 # FS QA Test No. 087
3 #
4 # * like 086 but want to create more/different kinds of metadata
5 #   and so will use fsstress
6 # * also can interrupt metadata with godown
7 #
8 #-----------------------------------------------------------------------
9 # Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
10 #
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.
14 #
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.
19 #
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 #
24 #-----------------------------------------------------------------------
25 #
26
27 seq=`basename $0`
28 echo "QA output created by $seq"
29
30 here=`pwd`
31 tmp=/tmp/$$
32 status=1        # failure is the default!
33 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
34
35 # get standard environment, filters and checks
36 . ./common.rc
37 . ./common.filter
38 . ./common.log
39 . ./common.quota
40
41 _do_meta()
42 {
43     out=$SCRATCH_MNT/fsstress
44     count=10000
45     param="-p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 \
46            -f rename=30 -f stat=30 -f unlink=30 -f truncate=20"
47     _echofull "calling fsstress $param -m8 -n $count"
48     FSSTRESS_ARGS=`_scale_fsstress_args $param $FSSTRESS_AVOID -m 8 -n $count -d $out`
49     if ! $FSSTRESS_PROG $FSSTRESS_ARGS >>$seq.full 2>&1
50     then
51         _echofull "fsstress failed"
52     fi
53 }
54
55 # real QA test starts here
56 _supported_fs xfs
57 _supported_os IRIX Linux
58
59 rm -f $seq.full $tmp.*
60 _require_scratch
61 _require_v2log 
62 _require_xfs_quota
63
64 echo "*** init FS"
65 umount $SCRATCH_DEV >/dev/null 2>&1
66
67 cat >$tmp.seq.params <<EOF
68 # mkfs-opt             mount-opt
69 # ------------------------------
70   version=2            logbsize=32k
71   version=2,su=4096    logbsize=32k
72   version=2,su=32768   logbsize=32k
73   version=2            logbsize=64k
74   version=2,su=64k     logbsize=64k
75   version=2            logbsize=128k
76   version=2,su=128k    logbsize=128k
77   version=2            logbsize=256k
78   version=2,su=256k    logbsize=256k
79 EOF
80
81 cat $tmp.seq.params \
82 | while read mkfs mnt restofline
83 do
84     if [ "$mkfs" = "#" ]; then 
85         continue
86     fi
87
88     echo "--- mkfs=$mkfs, mnt=$mnt ---"
89     export MKFS_OPTIONS="-l $mkfs"
90     export MOUNT_OPTIONS="-o $mnt"
91
92     # mkfs the FS
93     _echofull "mkfs"
94     _scratch_mkfs_xfs >>$seq.full 2>&1
95     if [ $? -ne 0 ] ; then 
96         _echofull "mkfs failed: $MKFS_OPTIONS"
97         continue
98     fi
99
100     # mount the FS
101     _echofull "mount"
102     if ! _scratch_mount -o uquota >>$seq.full 2>&1; then
103         _echofull "mount failed: $MOUNT_OPTIONS"
104         continue
105     fi
106
107     # create the metadata
108     _do_meta
109
110     # check before on what FS should look like
111     _echofull "ls -RF SCRATCH_MNT"
112     ls -RF $SCRATCH_MNT >$tmp.ls1
113
114     _echofull "godown"
115     src/godown -v -f $SCRATCH_MNT >> $seq.full
116
117     _echofull "unmount"
118     umount $SCRATCH_DEV >>$seq.full 2>&1 \
119         || _fail "umount failed"
120
121     _echofull "logprint after going down..."
122     _print_logstate
123
124     _full "logprint headers"
125     _scratch_xfs_logprint -n >>$seq.full 2>&1
126
127     _echofull "mount with replay"
128     _scratch_mount -o uquota >>$seq.full 2>&1 \
129         || _fail "mount failed: $MOUNT_OPTIONS"
130
131     # check on what FS looks like after log recovery
132     _echofull "ls -RF SCRATCH_MNT"
133     ls -RF $SCRATCH_MNT >$tmp.ls2
134
135     _echofull "diff ls before and after"
136     diff -us $tmp.ls1 $tmp.ls2 | sed "s#$tmp#TMP#g"
137
138     _echofull "unmount"
139     umount $SCRATCH_MNT
140
141     _echofull "logprint after mount and replay..."
142     _print_logstate
143
144     if _check_scratch_fs; then
145         _echofull "filesystem is checked ok"
146     else
147         _echofull "filesystem is NOT ok"
148     fi
149 done
150
151 status=0 
152 exit