generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / generic / 559
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2018 Red Hat Inc.  All Rights Reserved.
4 #
5 # FS QA Test generic/559
6 #
7 # Dedupe a single big file and verify integrity
8 #
9 . ./common/preamble
10 _begin_fstest auto stress dedupe
11
12 # Import common functions.
13 . ./common/filter
14 . ./common/reflink
15
16 # real QA test starts here
17 _supported_fs generic
18 _require_scratch_duperemove
19
20 fssize=$((2 * 1024 * 1024 * 1024))
21 _scratch_mkfs_sized $fssize > $seqres.full 2>&1
22 _scratch_mount >> $seqres.full 2>&1
23
24 # fill the fs with a big file has same contents
25 $XFS_IO_PROG -f -c "pwrite -S 0x55 0 $fssize" $SCRATCH_MNT/${seq}.file \
26         >> $seqres.full 2>&1
27 md5sum $SCRATCH_MNT/${seq}.file > ${tmp}.md5sum
28
29 echo "= before cycle mount ="
30 # Dedupe with 1M blocksize
31 $DUPEREMOVE_PROG -dr --dedupe-options=same -b 1048576 $SCRATCH_MNT/ >>$seqres.full 2>&1
32 # Verify integrity
33 md5sum -c --quiet ${tmp}.md5sum
34 # Dedupe with 64k blocksize
35 $DUPEREMOVE_PROG -dr --dedupe-options=same -b 65536 $SCRATCH_MNT/ >>$seqres.full 2>&1
36 # Verify integrity again
37 md5sum -c --quiet ${tmp}.md5sum
38
39 # umount and mount again, verify pagecache contents don't mutate
40 _scratch_cycle_mount
41 echo "= after cycle mount ="
42 md5sum -c --quiet ${tmp}.md5sum
43
44 status=0
45 exit