xfs/040: document purpose
[xfstests-dev.git] / tests / xfs / 040
1 #! /bin/bash
2 # FS QA Test No. 040
3 #
4 # compare-libxfs test
5 #
6 # The purpose of this test is only to nag the maintainer of xfsprogs to try to
7 # keep xfsprogs's libxfs files in sync with the latest kernel's libxfs. There
8 # is no functional need for anyone to actually run this test to confirm
9 # proper XFS functionalilty, this is an xfsprogs maintainer test.
10 #
11 #-----------------------------------------------------------------------
12 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
13 #
14 # This program is free software; you can redistribute it and/or
15 # modify it under the terms of the GNU General Public License as
16 # published by the Free Software Foundation.
17 #
18 # This program is distributed in the hope that it would be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 # GNU General Public License for more details.
22 #
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write the Free Software Foundation,
25 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
26 #
27 #-----------------------------------------------------------------------
28 #
29
30 seq=`basename $0`
31 seqres=$RESULT_DIR/$seq
32 echo "QA output created by $seq"
33
34 here=`pwd`
35 tmp=/tmp/$$
36 status=1        # failure is the default!
37 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
38
39 # get standard environment, filters and checks
40 . ./common/rc
41 . ./common/filter
42
43 [ -z "$KWORKAREA" ] && \
44         _notrun "Can't run libxfs-diff without KWORKAREA set"
45 [ -d "$KWORKAREA/fs/xfs" ] || \
46         _notrun "Can't find XFS source under \"$KWORKAREA\""
47
48 [ -z "$WORKAREA" ] && \
49         _notrun "Can't run libxfs-diff without WORKAREA set"
50 [ -f "$WORKAREA/tools/libxfs-diff" ] || \
51         _notrun "Can't find libxfs-diff tool under \"$WORKAREA\""
52
53 filter_libxfs_diff() {
54         sed -e 's/^--- libxfs/--- xfsprogs\/libxfs/g' \
55             -e 's/^+++ .*libxfs/+++ kernel\/libxfs/g' \
56             -e 's/^@@.*$/@@ -XXXX,X +YYYY,Y @@/g'
57 }
58
59 # Compare the two libxfses
60 (cd "$WORKAREA" ; ./tools/libxfs-diff "$KWORKAREA/fs/xfs/libxfs") | filter_libxfs_diff | tee -a $seqres.full
61
62 # success, all done
63 status=0
64 exit