Files
apfstests/tests/generic/559
T
Theodore Ts'o c3cb6fbde7 shared,generic: move tests using duperemove to generic/
Add _require_scratch_duperemove which validates that the file system
supports duperemove.  This allows us to move three tests from shared/
to generic/.  This means these tests will automatically adapt when
duperemove supports other file systems.  Tests moved are:

	shared/008 --> generic/559
	shared/009 --> generic/560
	shared/010 --> generic/561

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2019-07-05 16:10:10 +08:00

63 lines
1.5 KiB
Bash
Executable File

#! /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
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
cd /
rm -f $tmp.*
}
# get standard environment, filters and checks
. ./common/rc
. ./common/filter
. ./common/reflink
# remove previous $seqres.full before test
rm -f $seqres.full
# real QA test starts here
_supported_fs generic
_supported_os Linux
_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