xfs/{263,106}: erase max warnings printout
[xfstests-dev.git] / tests / generic / 439
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2017 SUSE Linux Products GmbH. All Rights Reserved.
4 #
5 # FS QA Test No. generic/439
6 #
7 # Test that if we punch a hole in a file, with either a range that goes beyond
8 # the file's size or covers a file range that is already a hole, and that if
9 # after we do some buffered write operations that cover different parts of the
10 # hole, no warnings are emmitted in syslog/dmesg and the file's content is
11 # correct after remounting the filesystem.
12 #
13 seq=`basename $0`
14 seqres=$RESULT_DIR/$seq
15 echo "QA output created by $seq"
16
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
20
21 _cleanup()
22 {
23         cd /
24         rm -f $tmp.*
25 }
26
27 # get standard environment, filters and checks
28 . ./common/rc
29 . ./common/filter
30
31 # real QA test starts here
32 _supported_fs generic
33 _supported_os Linux
34 _require_test
35 _require_scratch
36 _require_xfs_io_command "fpunch"
37
38 rm -f $seqres.full
39
40 _scratch_mkfs >>$seqres.full 2>&1
41 _scratch_mount
42
43 $XFS_IO_PROG -f -c "pwrite -S 0xaa 0 100K" $SCRATCH_MNT/f | _filter_xfs_io
44 $XFS_IO_PROG -c "fpunch 60K 90K" $SCRATCH_MNT/f
45 $XFS_IO_PROG -c "pwrite -S 0xbb -b 100K 50K 100K" $SCRATCH_MNT/f | _filter_xfs_io
46 $XFS_IO_PROG -c "pwrite -S 0xcc -b 50K 100K 50K" $SCRATCH_MNT/f | _filter_xfs_io
47
48 $XFS_IO_PROG -f -c "fpunch 695K 820K" $SCRATCH_MNT/f2
49 $XFS_IO_PROG -c "pwrite -S 0xaa 1008K 307K" $SCRATCH_MNT/f2 |  _filter_xfs_io
50 $XFS_IO_PROG -c "pwrite -S 0xbb -b 630K 1073K 630K" $SCRATCH_MNT/f2 \
51         | _filter_xfs_io
52 $XFS_IO_PROG -c "pwrite -S 0xcc -b 459K 1068K 459K" $SCRATCH_MNT/f2 \
53         | _filter_xfs_io
54
55 _scratch_cycle_mount
56
57 echo "File f contents after remounting filesystem:"
58 od -t x1 $SCRATCH_MNT/f
59 echo "File f2 contents after remounting filesystem:"
60 od -t x1 $SCRATCH_MNT/f2
61
62 status=0
63 exit