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>
This commit is contained in:
Theodore Ts'o
2019-06-28 18:59:10 -04:00
committed by Eryu Guan
parent a9868eb48d
commit c3cb6fbde7
10 changed files with 35 additions and 27 deletions
+18
View File
@@ -75,6 +75,24 @@ _require_scratch_reflink()
_scratch_unmount _scratch_unmount
} }
# this test requires duperemove working for the file system
_require_scratch_duperemove()
{
_require_scratch
_require_command "$DUPEREMOVE_PROG" duperemove
_scratch_mkfs > /dev/null
_scratch_mount
dd if=/dev/zero of="$SCRATCH_MNT/file1" bs=128k count=1 >& /dev/null
dd if=/dev/zero of="$SCRATCH_MNT/file2" bs=128k count=1 >& /dev/null
if ! "$DUPEREMOVE_PROG" -d "$SCRATCH_MNT/file1" \
"$SCRATCH_MNT/file2" >& /dev/null ; then
_scratch_unmount
_notrun "duperemove does not support file system type: $FSTYP"
fi
_scratch_unmount
}
# this test requires scratch fs to report explicit SHARED flag # this test requires scratch fs to report explicit SHARED flag
# e.g. # e.g.
# 0 4K 8K # 0 4K 8K
+4 -6
View File
@@ -2,7 +2,7 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2018 Red Hat Inc. All Rights Reserved. # Copyright (c) 2018 Red Hat Inc. All Rights Reserved.
# #
# FS QA Test 008 # FS QA Test generic/559
# #
# Dedupe a single big file and verify integrity # Dedupe a single big file and verify integrity
# #
@@ -29,12 +29,10 @@ _cleanup()
# remove previous $seqres.full before test # remove previous $seqres.full before test
rm -f $seqres.full rm -f $seqres.full
# duperemove only supports btrfs and xfs (with reflink feature). # real QA test starts here
# Add other filesystems if it supports more later. _supported_fs generic
_supported_fs xfs btrfs
_supported_os Linux _supported_os Linux
_require_scratch_dedupe _require_scratch_duperemove
_require_command "$DUPEREMOVE_PROG" duperemove
fssize=$((2 * 1024 * 1024 * 1024)) fssize=$((2 * 1024 * 1024 * 1024))
_scratch_mkfs_sized $fssize > $seqres.full 2>&1 _scratch_mkfs_sized $fssize > $seqres.full 2>&1
@@ -1,3 +1,3 @@
QA output created by 008 QA output created by 559
= before cycle mount = = before cycle mount =
= after cycle mount = = after cycle mount =
+3 -7
View File
@@ -2,7 +2,7 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2018 Red Hat Inc. All Rights Reserved. # Copyright (c) 2018 Red Hat Inc. All Rights Reserved.
# #
# FS QA Test 009 # FS QA Test generic/560
# #
# Iterate dedupe integrity test. Copy an original data0 several # Iterate dedupe integrity test. Copy an original data0 several
# times (d0 -> d1, d1 -> d2, ... dn-1 -> dn), dedupe dataN everytime # times (d0 -> d1, d1 -> d2, ... dn-1 -> dn), dedupe dataN everytime
@@ -32,13 +32,9 @@ _cleanup()
rm -f $seqres.full rm -f $seqres.full
# real QA test starts here # real QA test starts here
_supported_fs generic
# duperemove only supports btrfs and xfs (with reflink feature).
# Add other filesystems if it supports more later.
_supported_fs xfs btrfs
_supported_os Linux _supported_os Linux
_require_scratch_dedupe _require_scratch_duperemove
_require_command "$DUPEREMOVE_PROG" duperemove
_scratch_mkfs > $seqres.full 2>&1 _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1
@@ -1,4 +1,4 @@
QA output created by 009 QA output created by 560
= Do dedup and verify = = Do dedup and verify =
= Backwords verify = = Backwords verify =
= Verify after cycle mount = = Verify after cycle mount =
+3 -7
View File
@@ -2,7 +2,7 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2018 Red Hat Inc. All Rights Reserved. # Copyright (c) 2018 Red Hat Inc. All Rights Reserved.
# #
# FS QA Test 010 # FS QA Test generic/561
# #
# Dedup & random I/O race test, do multi-threads fsstress and dedupe on # Dedup & random I/O race test, do multi-threads fsstress and dedupe on
# same directory/files # same directory/files
@@ -32,13 +32,9 @@ _cleanup()
rm -f $seqres.full rm -f $seqres.full
# real QA test starts here # real QA test starts here
_supported_fs generic
# duperemove only supports btrfs and xfs (with reflink feature).
# Add other filesystems if it supports more later.
_supported_fs xfs btrfs
_supported_os Linux _supported_os Linux
_require_scratch_dedupe _require_scratch_duperemove
_require_command "$DUPEREMOVE_PROG" duperemove
_require_command "$KILLALL_PROG" killall _require_command "$KILLALL_PROG" killall
_scratch_mkfs > $seqres.full 2>&1 _scratch_mkfs > $seqres.full 2>&1
+2
View File
@@ -0,0 +1,2 @@
QA output created by 561
Silence is golden
+3
View File
@@ -561,3 +561,6 @@
556 auto quick casefold 556 auto quick casefold
557 auto quick log 557 auto quick log
558 auto enospc 558 auto enospc
559 auto stress dedupe
560 auto stress dedupe
561 auto stress dedupe
-2
View File
@@ -1,2 +0,0 @@
QA output created by 010
Silence is golden
-3
View File
@@ -4,9 +4,6 @@
# - comment line before each group is "new" description # - comment line before each group is "new" description
# #
002 auto metadata quick log 002 auto metadata quick log
008 auto stress dedupe
009 auto stress dedupe
010 auto stress dedupe
011 auto quick 011 auto quick
032 mkfs auto quick 032 mkfs auto quick
298 auto trim 298 auto trim