2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Oracle, Inc. All Rights Reserved.
7 # Check that cross-mountpoint dedupe doesn't work.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 7 15
25 # get standard environment, filters and checks
30 # real QA test starts here
32 _require_scratch_dedupe
34 echo "Format and mount"
35 _scratch_mkfs > $seqres.full 2>&1
36 _scratch_mount >> $seqres.full 2>&1
38 testdir=$SCRATCH_MNT/test-$seq
41 othertestdir=$otherdir/test-$seq
47 sz=$((blocks * blksz))
50 $MOUNT_PROG --bind $SCRATCH_MNT $otherdir
53 _pwrite_byte 0x61 0 $sz $testdir/file >> $seqres.full
54 _pwrite_byte 0x61 0 $sz $testdir/otherfile >> $seqres.full
56 echo "Dedupe one file to another"
57 _dedupe_range $testdir/file 0 $othertestdir/otherfile 0 $sz 2>&1 | _filter_dedupe_error
61 _filter_scratch | sed -e "s,$otherdir,OTHER_DIR,g"
64 md5sum $testdir/file $othertestdir/otherfile | filter_md5
66 echo "Unmount otherdir"
67 $UMOUNT_PROG $otherdir