summaryrefslogtreecommitdiff
path: root/tests/generic/559
blob: 98ab447426ce77f6808db287f4c0de3247c0124e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2018 Red Hat Inc.  All Rights Reserved.
#
# FS QA Test generic/559
#
# Dedupe a single big file and verify integrity
#
. ./common/preamble
_begin_fstest auto stress dedupe

# Import common functions.
. ./common/filter
. ./common/reflink

# real QA test starts here
_supported_fs generic
_require_scratch_duperemove

fssize=$((2 * 1024 * 1024 * 1024))
_scratch_mkfs_sized $fssize > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1

# fill the fs with a big file has same contents
$XFS_IO_PROG -f -c "pwrite -S 0x55 0 $fssize" $SCRATCH_MNT/${seq}.file \
	>> $seqres.full 2>&1
md5sum $SCRATCH_MNT/${seq}.file > ${tmp}.md5sum

echo "= before cycle mount ="
# Dedupe with 1M blocksize
$DUPEREMOVE_PROG -dr --dedupe-options=same -b 1048576 $SCRATCH_MNT/ >>$seqres.full 2>&1
# Verify integrity
md5sum -c --quiet ${tmp}.md5sum
# Dedupe with 64k blocksize
$DUPEREMOVE_PROG -dr --dedupe-options=same -b 65536 $SCRATCH_MNT/ >>$seqres.full 2>&1
# Verify integrity again
md5sum -c --quiet ${tmp}.md5sum

# umount and mount again, verify pagecache contents don't mutate
_scratch_cycle_mount
echo "= after cycle mount ="
md5sum -c --quiet ${tmp}.md5sum

status=0
exit