Add GPL license plate to SGI's test files.
[xfstests-dev.git] / 029
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. 029
22 #
23 # exercise mkfs log (internal/external) zeroing
24 #
25 # creator
26 owner=nathans@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 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
35
36 # get standard environment, filters and checks
37 . ./common.rc
38 . ./common.filter
39
40 _filter_logprint()
41 {
42         perl -ne '
43             s/data device: ([\w|\/.-]+)/data device: DDEV/;
44             s/log device: ([\w|\/.-]+) daddr: (\d+) length: (\d+)/log device: LDEV daddr: XXX length: XXX/;
45             s/log file: "([\w|\/.-]+)" daddr: (\d+) length: (\d+)/log device: LDEV daddr: XXX length: XXX/;
46             s/skipped (\w+) zeroed blocks/skipped XXX zeroed blocks/;
47             s/in range: \d+ - \d+/in range: XXX - XXX/;
48             s/^uuid: *[0-9a-f-][0-9a-f-]* *format: *.*$/uuid: <UUID> format: <FORMAT>/;
49             s/(length of Log Record:) \d+/$1 <LEN>/;
50             s/version: \d/version: <VERN>/;
51             s/h_size: \d+/h_size: <H_SIZE>/;
52             print;
53         '
54 }
55
56 # real QA test starts here
57 _supported_fs xfs
58 _supported_os Linux
59
60 _require_scratch
61
62 echo
63 _scratch_mkfs_xfs | _filter_mkfs 2>/dev/null
64
65 echo
66 _scratch_xfs_logprint | _filter_logprint
67
68 status=0
69 exit