fstests: move test group info to test files

Refactor every test in the entire test suite to use the new boilerplate
functions.  This also migrates all the test group information into the
test files.  This patch has been autogenerated via the command:

./tools/convert-group btrfs ceph cifs ext4 f2fs generic nfs ocfs2 overlay perf shared udf xfs

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Darrick J. Wong
2021-06-21 08:55:09 -07:00
committed by Eryu Guan
parent 827136e6f3
commit 7e98d41a6e
1581 changed files with 5563 additions and 22410 deletions
+3 -16
View File
@@ -6,23 +6,10 @@
#
# Test btrfs's subvolume and snapshot support
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/preamble
_begin_fstest auto quick subvol snapshot
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
{
rm -f $tmp.*
}
trap "_cleanup ; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
# Import common functions.
. ./common/filter
. ./common/filter.btrfs
+3 -16
View File
@@ -6,23 +6,10 @@
#
# Extented btrfs snapshot test cases
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/preamble
_begin_fstest auto snapshot
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
{
rm -f $tmp.*
}
trap "_cleanup ; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
# Import common functions.
. ./common/filter
_supported_fs btrfs
+4 -11
View File
@@ -6,16 +6,11 @@
#
# btrfs vol tests
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/preamble
_begin_fstest auto replace volume balance
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
dev_removed=0
removed_dev_htl=""
trap "_cleanup; exit \$status" 0 1 2 3 15
# Check if all scratch dev pools are deletable
deletable_scratch_dev_pool()
@@ -32,6 +27,7 @@ deletable_scratch_dev_pool()
return 0
}
# Override the default cleanup function.
_cleanup()
{
cd /
@@ -42,8 +38,7 @@ _cleanup()
fi
}
# get standard environment, filters and checks
. ./common/rc
# Import common functions.
. ./common/filter
_supported_fs btrfs
@@ -51,8 +46,6 @@ _require_scratch
_require_scratch_dev_pool 4
_require_command "$WIPEFS_PROG" wipefs
rm -f $seqres.full
# Test cases related to raid in btrfs
_test_raid0()
{
+4 -11
View File
@@ -9,25 +9,20 @@
# run filefrag to get the extent mapping and follow the backrefs.
# We check to end up back at the original file with the correct offset.
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/preamble
_begin_fstest auto rw metadata
here=`pwd`
tmp=/tmp/$$
status=1
noise_pid=0
# Override the default cleanup function.
_cleanup()
{
rm $tmp.running
wait
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
# Import common functions.
. ./common/filter
# real QA test starts here
@@ -38,8 +33,6 @@ _require_btrfs_command inspect-internal logical-resolve
_require_btrfs_command inspect-internal inode-resolve
_require_command "$FILEFRAG_PROG" filefrag
rm -f $seqres.full
FILEFRAG_FILTER='
if (/blocks? of (\d+) bytes/) {
$blocksize = $1;
+3 -18
View File
@@ -6,23 +6,11 @@
#
# Btrfs Online defragmentation tests
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here="`pwd`"
tmp=/tmp/$$
. ./common/preamble
_begin_fstest auto defrag
cnt=119
filesize=48000
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
cd /
rm -f $tmp.*
}
_create_file()
{
if [ $1 -ne 2 ]; then
@@ -111,8 +99,7 @@ _rundefrag()
_check_scratch_fs
}
# get standard environment, filters and checks
. ./common/rc
# Import common functions.
. ./common/filter
. ./common/defrag
@@ -120,8 +107,6 @@ _rundefrag()
_supported_fs btrfs
_require_scratch
rm -f $seqres.full
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
_require_defrag
+3 -18
View File
@@ -7,23 +7,10 @@
# run basic btrfs information commands in various ways
# sanity tests: filesystem show, label, sync, and device stats
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/preamble
_begin_fstest auto quick volume
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
# Import common functions.
. ./common/filter.btrfs
# real QA test starts here
@@ -33,8 +20,6 @@ _supported_fs btrfs
_require_scratch
_require_scratch_dev_pool
rm -f $seqres.full
FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $NF}'`
TOTAL_DEVS=`echo $SCRATCH_DEV_POOL | wc -w`
+4 -10
View File
@@ -12,23 +12,18 @@
# creator
owner=list.btrfs@jan-o-sch.net
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
tmp=/tmp/$$
status=1
. ./common/preamble
_begin_fstest auto quick rw metadata send seek
# Override the default cleanup function.
_cleanup()
{
cd /
rm -f $tmp.*
rm -fr $send_files_dir
}
trap "_cleanup; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
# Import common functions.
. ./common/filter
# real QA test starts here
@@ -39,7 +34,6 @@ _require_seek_data_hole
send_files_dir=$TEST_DIR/btrfs-test-$seq
rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
+4 -11
View File
@@ -6,16 +6,12 @@
#
# btrfs send ENOENT regression test, from a user report on linux-btrfs
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/preamble
_begin_fstest auto quick send
here=`pwd`
tmp=/tmp/$$
tmp_dir=send_temp_$seq
status=1 # failure is the default!
# Override the default cleanup function.
_cleanup()
{
$BTRFS_UTIL_PROG subvolume delete $TEST_DIR/$tmp_dir/send/snapshots/backup2 > /dev/null 2>&1
@@ -25,10 +21,7 @@ _cleanup()
rm -f $tmp.*
}
trap "_cleanup ; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
# Import common functions.
. ./common/filter
# real QA test starts here
+3 -19
View File
@@ -6,32 +6,16 @@
#
# Regression test to make sure we can't delete the default subvol
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/preamble
_begin_fstest auto quick subvol
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
{
rm -f $tmp.*
}
trap "_cleanup ; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
# Import common functions.
. ./common/filter
# real QA test starts here
_supported_fs btrfs
_require_scratch
rm -f $seqres.full
_scratch_mkfs > /dev/null 2>&1
_scratch_mount
+3 -11
View File
@@ -8,28 +8,20 @@
# Regression test for patch "Btrfs: fix delalloc accounting leak caused
# by u32 overflow".
#
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
. ./common/preamble
_begin_fstest auto
test_file="$TEST_DIR/$seq"
# Override the default cleanup function.
_cleanup()
{
cd /
rm -f $tmp.* "$test_file"
}
. ./common/rc
. ./common/filter
rm -f $seqres.full
_supported_fs btrfs
_require_test
_require_btrfs_fs_sysfs
+4 -10
View File
@@ -19,15 +19,12 @@
# To check the filesystems after replacing a device, a scrub run is
# performed, a btrfsck run, and finally the filesystem is remounted.
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/preamble
_begin_fstest auto replace volume
here=`pwd`
tmp=/tmp/$$
status=1
noise_pid=0
# Override the default cleanup function.
_cleanup()
{
if [ $noise_pid -ne 0 ] && ps -p $noise_pid | grep -q $noise_pid; then
@@ -40,10 +37,8 @@ _cleanup()
# needed by _require_scratch, and make it umounted.
_scratch_unmount > /dev/null 2>&1
}
trap "_cleanup; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
# Import common functions.
. ./common/filter
# real QA test starts here
@@ -54,7 +49,6 @@ _require_scratch_dev_pool_equal_size
_require_scratch_size $((10 * 1024 * 1024)) #kB
_require_command "$WIPEFS_PROG" wipefs
rm -f $seqres.full
rm -f $tmp.*
echo "*** test btrfs replace"
+3 -18
View File
@@ -13,23 +13,10 @@
# 5) roll back conversion to original ext4
# 6) verify rolled-back fs integrity & contents
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/preamble
_begin_fstest auto convert
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
# Import common functions.
. ./common/filter.btrfs
# real QA test starts here
@@ -44,8 +31,6 @@ _require_command "$E2FSCK_PROG" e2fsck
_require_fs_space $SCRATCH_MNT $(du -s /lib/modules/`uname -r` | ${AWK_PROG} '{print $1}')
rm -f $seqres.full
BLOCK_SIZE=`_get_block_size $TEST_DIR`
# Create & populate an ext4 filesystem
+3 -19
View File
@@ -10,24 +10,10 @@
# userspace doesn't get an error when reading the file back so we have to grok
# dmesg to see if there was a csum error.
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/preamble
_begin_fstest auto quick balance
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
{
rm -f $tmp.*
}
trap "_cleanup ; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
# Import common functions.
. ./common/filter
# real QA test starts here
@@ -35,8 +21,6 @@ _supported_fs btrfs
_require_scratch
_require_xfs_io_command "falloc"
rm -f $seqres.full
_scratch_mkfs > /dev/null 2>&1
_scratch_mount
+2 -8
View File
@@ -6,13 +6,8 @@
#
# Btrfs balance tests
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here="`pwd`"
tmp=/tmp/$$
status=1 # failure is the default!
. ./common/preamble
_begin_fstest auto balance
_create_snapshot()
{
@@ -32,7 +27,6 @@ _balance()
}
#get standard environment, filters and checks
. ./common/rc
. ./common/filter
# real QA test starts here
+3 -19
View File
@@ -7,32 +7,16 @@
# Regression test to make sure we can create a snapshot after mounting with
# readonly and remounting rw.
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/preamble
_begin_fstest auto quick snapshot
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
{
rm -f $tmp.*
}
trap "_cleanup ; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
# Import common functions.
. ./common/filter
# real QA test starts here
_supported_fs btrfs
_require_scratch
rm -f $seqres.full
_scratch_mkfs > /dev/null 2>&1
_scratch_mount -o ro
_scratch_mount -o rw,remount
+4 -9
View File
@@ -6,15 +6,13 @@
#
# btrfs send hole punch test
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/preamble
_begin_fstest auto quick send
tmp=`mktemp -d`
tmp_dir=send_temp_$seq
status=1 # failure is the default!
# Override the default cleanup function.
_cleanup()
{
$BTRFS_UTIL_PROG subvolume delete $TEST_DIR/$tmp_dir/snap > /dev/null 2>&1
@@ -24,10 +22,7 @@ _cleanup()
rm -f $tmp.*
}
trap "_cleanup ; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
# Import common functions.
. ./common/filter
# real QA test starts here
+3 -18
View File
@@ -12,23 +12,10 @@
# The issue is fixed by https://patchwork.kernel.org/patch/5499981/
# "Btrfs: fix a warning of qgroup account on shared extents"
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/preamble
_begin_fstest auto quick qgroup
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
# Import common functions.
. ./common/filter
# real QA test starts here
@@ -37,8 +24,6 @@ _supported_fs btrfs
_require_scratch
_require_cloner
rm -f $seqres.full
# Currently in btrfs the node/leaf size can not be smaller than the page
# size (but it can be greater than the page size). So use the largest
# supported node/leaf size (64Kb) so that the test can run on any platform
+3 -19
View File
@@ -6,32 +6,16 @@
#
# Regression test to make sure we can move a subvol into another subvol
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/preamble
_begin_fstest auto quick subvol
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
{
rm -f $tmp.*
}
trap "_cleanup ; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
# Import common functions.
. ./common/filter
# real QA test starts here
_supported_fs btrfs
_require_scratch
rm -f $seqres.full
_scratch_mkfs > /dev/null 2>&1
_scratch_mount
$BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/test1 >> $seqres.full 2>&1 \
+4 -11
View File
@@ -6,16 +6,12 @@
#
# btrfs send ENOENT regression test, kernel bugzilla 60673
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
. ./common/preamble
_begin_fstest auto quick send
here=`pwd`
tmp=/tmp/$$
tmp_dir=send_temp_$seq
status=1 # failure is the default!
# Override the default cleanup function.
_cleanup()
{
$BTRFS_UTIL_PROG subvolume delete $TEST_DIR/$tmp_dir/snap1 > /dev/null 2>&1
@@ -25,10 +21,7 @@ _cleanup()
rm -f $tmp.*
}
trap "_cleanup ; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
# Import common functions.
. ./common/filter
# real QA test starts here
+4 -13
View File
@@ -9,15 +9,10 @@
# Regression test for commit:
# bbb651e Btrfs: don't allow the replace procedure on read only filesystems
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
. ./common/preamble
_begin_fstest auto quick replace volume
# Override the default cleanup function.
_cleanup()
{
cd /
@@ -30,10 +25,7 @@ _cleanup()
rm -f $fs_img1 $fs_img2 $fs_img3
}
trap "_cleanup ; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
# Import common functions.
. ./common/filter
# real QA test starts here
@@ -41,7 +33,6 @@ _supported_fs btrfs
_require_test
_require_loop
rm -f $seqres.full
echo "Silence is golden"
loop_mnt=$TEST_DIR/$seq.$$.mnt

Some files were not shown because too many files have changed in this diff Show More