generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / xfs / 040
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 040
6 #
7 # compare-libxfs test
8 #
9 # The purpose of this test is only to nag the maintainer of xfsprogs to try to
10 # keep xfsprogs's libxfs files in sync with the latest kernel's libxfs. There
11 # is no functional need for anyone to actually run this test to confirm
12 # proper XFS functionalilty, this is an xfsprogs maintainer test.
13 #
14 . ./common/preamble
15 _begin_fstest other auto
16
17 # Import common functions.
18 . ./common/filter
19
20 [ -z "$KWORKAREA" ] && \
21         _notrun "Can't run libxfs-diff without KWORKAREA set"
22 [ -d "$KWORKAREA/fs/xfs" ] || \
23         _notrun "Can't find XFS source under \"$KWORKAREA\""
24
25 [ -z "$WORKAREA" ] && \
26         _notrun "Can't run libxfs-diff without WORKAREA set"
27 [ -f "$WORKAREA/tools/libxfs-diff" ] || \
28         _notrun "Can't find libxfs-diff tool under \"$WORKAREA\""
29
30 filter_libxfs_diff() {
31         sed -e 's/^--- libxfs/--- xfsprogs\/libxfs/g' \
32             -e 's/^+++ .*libxfs/+++ kernel\/libxfs/g' \
33             -e 's/^@@.*$/@@ -XXXX,X +YYYY,Y @@/g'
34 }
35
36 # Compare the two libxfses
37 (cd "$WORKAREA" ; ./tools/libxfs-diff "$KWORKAREA/fs/xfs/libxfs") | filter_libxfs_diff | tee -a $seqres.full
38
39 # success, all done
40 status=0
41 exit