4 # external log uuid/format tests (TODO - version 2 log format)
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
8 #-----------------------------------------------------------------------
10 #-----------------------------------------------------------------------
11 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
13 # This program is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU General Public License as
15 # published by the Free Software Foundation.
17 # This program is distributed in the hope that it would be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write the Free Software Foundation,
24 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 #-----------------------------------------------------------------------
30 seqres=$RESULT_DIR/$seq
31 echo "QA output created by $seq"
35 status=1 # failure is the default!
36 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
38 # get standard environment, filters and checks
42 # real QA test starts here
51 s/data device: ([\w|\/.-]+)/data device: DDEV/;
52 s/log device: ([\w|\/.-]+) daddr: (\d+) length: (\d+)/log device: LDEV daddr: XXX length: XXX/;
53 s/log file: "([\w|\/.-]+)" daddr: (\d+) length: (\d+)/log device: LDEV daddr: XXX length: XXX/;
54 s/uuid: ([abcdef\d-]+)\s+format: (.+)/uuid: UUID format: FORMAT/;
55 s/skipped (\w+) zeroed blocks/skipped XXX zeroed blocks/;
62 echo " *** mount (expect success)"
65 echo " !!! mount failed (expecting success)"
73 echo " !!! umount failed (expecting success)"
81 echo " *** mount (expect failure)"
82 if _scratch_mount >$tmp.err 2>&1
85 echo " !!! mount succeeded (expecting failure)"
91 _check_require_logdev()
93 echo " *** mount without logdev (expect failure)"
94 if mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >$tmp.err 2>&1
97 echo " !!! mount succeeded (expecting failure)"
105 echo " !!! unexpected XFS command failure"
110 # real QA test starts here
116 # this test only works for version 1 logs currently
119 _scratch_mkfs_xfs -lsize=$lsize,version=$lversion >$tmp.mkfs0 2>&1
121 _notrun "Cannot mkfs for this test using MKFS_OPTIONS specified"
122 _filter_mkfs <$tmp.mkfs0 2>$tmp.mkfs1
124 [ $lversion -ne 1 ] && \
125 _notrun "Cannot run this test yet using MKFS_OPTIONS specified"
127 _require_test_program "loggen"
130 _check_require_logdev
133 _scratch_xfs_db -x -l $SCRATCH_LOGDEV -c "uuid 02020202-0202-0202-0202-020202020202"
134 [ $? -ne 0 ] && _unexpected
138 $here/src/loggen -z 100 >$SCRATCH_LOGDEV
141 echo "*** write clean log"
142 $here/src/loggen -u 2 -f 1 -m 1 -z 100 >$SCRATCH_LOGDEV
145 echo "*** write clean log (different format)"
146 $here/src/loggen -u 2 -f 99 -m 1 -z 100 >$SCRATCH_LOGDEV
149 echo "*** write clean log (different uuid)"
150 $here/src/loggen -u 7 -m 1 -z 100 >$SCRATCH_LOGDEV
153 echo "*** write clean log (different uuid & format)"
154 $here/src/loggen -u 7 -f 99 -m 1 -z 100 >$SCRATCH_LOGDEV
157 echo "*** write dirty log"
158 $here/src/loggen -u 2 -e 1 -z 100 >$SCRATCH_LOGDEV
161 echo "*** write dirty log (different format)"
162 $here/src/loggen -u 2 -f 99 -e 1 -z 100 >$SCRATCH_LOGDEV
165 echo "*** write dirty log (irix style)"
166 $here/src/loggen -u 0 -f 0 -e 1 -z 100 >$SCRATCH_LOGDEV
169 echo "*** write large dirty log"
170 $here/src/loggen -u 2 -e 16000 -z 100 >$SCRATCH_LOGDEV
173 echo -e -n "\n\r*** XFS QA 044 - done\n\r\n\r" >/dev/console