xfs/{263,106}: erase max warnings printout
[xfstests-dev.git] / tests / generic / 374
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Oracle, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 374
6 #
7 # Check that cross-mountpoint dedupe doesn't work.
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 7 15
17
18 _cleanup()
19 {
20         cd /
21         rm -rf $tmp.*
22         wait
23 }
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28 . ./common/reflink
29
30 # real QA test starts here
31 _supported_os Linux
32 _supported_fs generic
33 _require_scratch_dedupe
34
35 echo "Format and mount"
36 _scratch_mkfs > $seqres.full 2>&1
37 _scratch_mount >> $seqres.full 2>&1
38
39 testdir=$SCRATCH_MNT/test-$seq
40 mkdir $testdir
41 otherdir=/tmp/m.$seq
42 othertestdir=$otherdir/test-$seq
43 rm -rf $otherdir
44 mkdir $otherdir
45
46 blocks=1
47 blksz=65536
48 sz=$((blocks * blksz))
49
50 echo "Mount otherdir"
51 $MOUNT_PROG --bind $SCRATCH_MNT $otherdir
52
53 echo "Create file"
54 _pwrite_byte 0x61 0 $sz $testdir/file >> $seqres.full
55 _pwrite_byte 0x61 0 $sz $testdir/otherfile >> $seqres.full
56
57 echo "Dedupe one file to another"
58 _dedupe_range $testdir/file 0 $othertestdir/otherfile 0 $sz 2>&1 | _filter_dedupe_error
59
60 filter_md5()
61 {
62         _filter_scratch | sed -e "s,$otherdir,OTHER_DIR,g"
63 }
64 echo "Check output"
65 md5sum $testdir/file $othertestdir/otherfile | filter_md5
66
67 echo "Unmount otherdir"
68 $UMOUNT_PROG $otherdir
69 rm -rf $otherdir
70
71 # success, all done
72 status=0
73 exit