summaryrefslogtreecommitdiff
path: root/tests/btrfs
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-06-21 08:55:09 -0700
committerEryu Guan <guaneryu@gmail.com>2021-06-27 22:50:02 +0800
commit7e98d41a6e009f348cd328e4b3bda2fd4352b94e (patch)
treea82ec4d292532f04a6e73d0e0832653f8048cb02 /tests/btrfs
parent827136e6f36ddcba5b2c7a625ee00d0ed25a6990 (diff)
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>
Diffstat (limited to 'tests/btrfs')
-rwxr-xr-xtests/btrfs/00119
-rwxr-xr-xtests/btrfs/00219
-rwxr-xr-xtests/btrfs/00315
-rwxr-xr-xtests/btrfs/00415
-rwxr-xr-xtests/btrfs/00521
-rwxr-xr-xtests/btrfs/00621
-rwxr-xr-xtests/btrfs/00714
-rwxr-xr-xtests/btrfs/00815
-rwxr-xr-xtests/btrfs/00922
-rwxr-xr-xtests/btrfs/01014
-rwxr-xr-xtests/btrfs/01114
-rwxr-xr-xtests/btrfs/01223
-rwxr-xr-xtests/btrfs/01322
-rwxr-xr-xtests/btrfs/01410
-rwxr-xr-xtests/btrfs/01522
-rwxr-xr-xtests/btrfs/01613
-rwxr-xr-xtests/btrfs/01721
-rwxr-xr-xtests/btrfs/01822
-rwxr-xr-xtests/btrfs/01915
-rwxr-xr-xtests/btrfs/02017
-rwxr-xr-xtests/btrfs/02121
-rwxr-xr-xtests/btrfs/02221
-rwxr-xr-xtests/btrfs/02320
-rwxr-xr-xtests/btrfs/02420
-rwxr-xr-xtests/btrfs/02514
-rwxr-xr-xtests/btrfs/02619
-rwxr-xr-xtests/btrfs/02722
-rwxr-xr-xtests/btrfs/02822
-rwxr-xr-xtests/btrfs/02921
-rwxr-xr-xtests/btrfs/03014
-rwxr-xr-xtests/btrfs/03121
-rwxr-xr-xtests/btrfs/03219
-rwxr-xr-xtests/btrfs/03322
-rwxr-xr-xtests/btrfs/03414
-rwxr-xr-xtests/btrfs/03519
-rwxr-xr-xtests/btrfs/03617
-rwxr-xr-xtests/btrfs/03714
-rwxr-xr-xtests/btrfs/03813
-rwxr-xr-xtests/btrfs/03913
-rwxr-xr-xtests/btrfs/04013
-rwxr-xr-xtests/btrfs/04115
-rwxr-xr-xtests/btrfs/04221
-rwxr-xr-xtests/btrfs/04313
-rwxr-xr-xtests/btrfs/04413
-rwxr-xr-xtests/btrfs/04513
-rwxr-xr-xtests/btrfs/04612
-rwxr-xr-xtests/btrfs/04724
-rwxr-xr-xtests/btrfs/04816
-rwxr-xr-xtests/btrfs/04917
-rwxr-xr-xtests/btrfs/05014
-rwxr-xr-xtests/btrfs/05114
-rwxr-xr-xtests/btrfs/05215
-rwxr-xr-xtests/btrfs/05314
-rwxr-xr-xtests/btrfs/05414
-rwxr-xr-xtests/btrfs/05515
-rwxr-xr-xtests/btrfs/05615
-rwxr-xr-xtests/btrfs/05723
-rwxr-xr-xtests/btrfs/05815
-rwxr-xr-xtests/btrfs/05917
-rwxr-xr-xtests/btrfs/06021
-rwxr-xr-xtests/btrfs/06121
-rwxr-xr-xtests/btrfs/06221
-rwxr-xr-xtests/btrfs/06321
-rwxr-xr-xtests/btrfs/06421
-rwxr-xr-xtests/btrfs/06521
-rwxr-xr-xtests/btrfs/06621
-rwxr-xr-xtests/btrfs/06721
-rwxr-xr-xtests/btrfs/06821
-rwxr-xr-xtests/btrfs/06921
-rwxr-xr-xtests/btrfs/07021
-rwxr-xr-xtests/btrfs/07121
-rwxr-xr-xtests/btrfs/07221
-rwxr-xr-xtests/btrfs/07321
-rwxr-xr-xtests/btrfs/07421
-rwxr-xr-xtests/btrfs/07515
-rwxr-xr-xtests/btrfs/07617
-rwxr-xr-xtests/btrfs/07712
-rwxr-xr-xtests/btrfs/07813
-rwxr-xr-xtests/btrfs/07915
-rwxr-xr-xtests/btrfs/08014
-rwxr-xr-xtests/btrfs/08118
-rwxr-xr-xtests/btrfs/08219
-rwxr-xr-xtests/btrfs/08314
-rwxr-xr-xtests/btrfs/08414
-rwxr-xr-xtests/btrfs/08517
-rwxr-xr-xtests/btrfs/08619
-rwxr-xr-xtests/btrfs/08714
-rwxr-xr-xtests/btrfs/08819
-rwxr-xr-xtests/btrfs/08923
-rwxr-xr-xtests/btrfs/09021
-rwxr-xr-xtests/btrfs/09120
-rwxr-xr-xtests/btrfs/09214
-rwxr-xr-xtests/btrfs/09319
-rwxr-xr-xtests/btrfs/09415
-rwxr-xr-xtests/btrfs/09515
-rwxr-xr-xtests/btrfs/09618
-rwxr-xr-xtests/btrfs/09714
-rwxr-xr-xtests/btrfs/09815
-rwxr-xr-xtests/btrfs/09921
-rwxr-xr-xtests/btrfs/10018
-rwxr-xr-xtests/btrfs/10118
-rwxr-xr-xtests/btrfs/10220
-rwxr-xr-xtests/btrfs/10319
-rwxr-xr-xtests/btrfs/10424
-rwxr-xr-xtests/btrfs/10514
-rwxr-xr-xtests/btrfs/10619
-rwxr-xr-xtests/btrfs/10722
-rwxr-xr-xtests/btrfs/10814
-rwxr-xr-xtests/btrfs/10914
-rwxr-xr-xtests/btrfs/11014
-rwxr-xr-xtests/btrfs/11114
-rwxr-xr-xtests/btrfs/11219
-rwxr-xr-xtests/btrfs/11319
-rwxr-xr-xtests/btrfs/11422
-rwxr-xr-xtests/btrfs/11523
-rwxr-xr-xtests/btrfs/11619
-rwxr-xr-xtests/btrfs/11718
-rwxr-xr-xtests/btrfs/11814
-rwxr-xr-xtests/btrfs/11914
-rwxr-xr-xtests/btrfs/12014
-rwxr-xr-xtests/btrfs/12124
-rwxr-xr-xtests/btrfs/12225
-rwxr-xr-xtests/btrfs/12322
-rwxr-xr-xtests/btrfs/12417
-rwxr-xr-xtests/btrfs/12518
-rwxr-xr-xtests/btrfs/12624
-rwxr-xr-xtests/btrfs/12714
-rwxr-xr-xtests/btrfs/12814
-rwxr-xr-xtests/btrfs/12914
-rwxr-xr-xtests/btrfs/13022
-rwxr-xr-xtests/btrfs/13122
-rwxr-xr-xtests/btrfs/13217
-rwxr-xr-xtests/btrfs/13314
-rwxr-xr-xtests/btrfs/13414
-rwxr-xr-xtests/btrfs/13514
-rwxr-xr-xtests/btrfs/13624
-rwxr-xr-xtests/btrfs/13714
-rwxr-xr-xtests/btrfs/13822
-rwxr-xr-xtests/btrfs/13923
-rwxr-xr-xtests/btrfs/14022
-rwxr-xr-xtests/btrfs/14122
-rwxr-xr-xtests/btrfs/14224
-rwxr-xr-xtests/btrfs/14324
-rwxr-xr-xtests/btrfs/14414
-rwxr-xr-xtests/btrfs/14514
-rwxr-xr-xtests/btrfs/14616
-rwxr-xr-xtests/btrfs/14714
-rwxr-xr-xtests/btrfs/14820
-rwxr-xr-xtests/btrfs/14914
-rwxr-xr-xtests/btrfs/15022
-rwxr-xr-xtests/btrfs/15122
-rwxr-xr-xtests/btrfs/15220
-rwxr-xr-xtests/btrfs/15322
-rwxr-xr-xtests/btrfs/15421
-rwxr-xr-xtests/btrfs/15514
-rwxr-xr-xtests/btrfs/15624
-rwxr-xr-xtests/btrfs/15722
-rwxr-xr-xtests/btrfs/15822
-rwxr-xr-xtests/btrfs/15914
-rwxr-xr-xtests/btrfs/16016
-rwxr-xr-xtests/btrfs/16122
-rwxr-xr-xtests/btrfs/16222
-rwxr-xr-xtests/btrfs/16317
-rwxr-xr-xtests/btrfs/16417
-rwxr-xr-xtests/btrfs/16522
-rwxr-xr-xtests/btrfs/16614
-rwxr-xr-xtests/btrfs/16722
-rwxr-xr-xtests/btrfs/16813
-rwxr-xr-xtests/btrfs/16913
-rwxr-xr-xtests/btrfs/17019
-rwxr-xr-xtests/btrfs/17124
-rwxr-xr-xtests/btrfs/17222
-rwxr-xr-xtests/btrfs/17319
-rwxr-xr-xtests/btrfs/17419
-rwxr-xr-xtests/btrfs/17519
-rwxr-xr-xtests/btrfs/17622
-rwxr-xr-xtests/btrfs/17719
-rwxr-xr-xtests/btrfs/17814
-rwxr-xr-xtests/btrfs/17922
-rwxr-xr-xtests/btrfs/18024
-rwxr-xr-xtests/btrfs/18122
-rwxr-xr-xtests/btrfs/18224
-rwxr-xr-xtests/btrfs/18319
-rwxr-xr-xtests/btrfs/18421
-rwxr-xr-xtests/btrfs/18517
-rwxr-xr-xtests/btrfs/18613
-rwxr-xr-xtests/btrfs/18719
-rwxr-xr-xtests/btrfs/18813
-rwxr-xr-xtests/btrfs/18913
-rwxr-xr-xtests/btrfs/19024
-rwxr-xr-xtests/btrfs/19114
-rwxr-xr-xtests/btrfs/19217
-rwxr-xr-xtests/btrfs/19322
-rwxr-xr-xtests/btrfs/19422
-rwxr-xr-xtests/btrfs/19523
-rwxr-xr-xtests/btrfs/19616
-rwxr-xr-xtests/btrfs/19717
-rwxr-xr-xtests/btrfs/19822
-rwxr-xr-xtests/btrfs/19918
-rwxr-xr-xtests/btrfs/20013
-rwxr-xr-xtests/btrfs/20115
-rwxr-xr-xtests/btrfs/20221
-rwxr-xr-xtests/btrfs/20313
-rwxr-xr-xtests/btrfs/20422
-rwxr-xr-xtests/btrfs/20520
-rwxr-xr-xtests/btrfs/20622
-rwxr-xr-xtests/btrfs/20722
-rwxr-xr-xtests/btrfs/20810
-rwxr-xr-xtests/btrfs/20914
-rwxr-xr-xtests/btrfs/21024
-rwxr-xr-xtests/btrfs/21114
-rwxr-xr-xtests/btrfs/21217
-rwxr-xr-xtests/btrfs/21317
-rwxr-xr-xtests/btrfs/21416
-rwxr-xr-xtests/btrfs/21522
-rwxr-xr-xtests/btrfs/21624
-rwxr-xr-xtests/btrfs/21725
-rwxr-xr-xtests/btrfs/21822
-rwxr-xr-xtests/btrfs/21917
-rwxr-xr-xtests/btrfs/22016
-rwxr-xr-xtests/btrfs/22114
-rwxr-xr-xtests/btrfs/22214
-rwxr-xr-xtests/btrfs/22320
-rwxr-xr-xtests/btrfs/22423
-rwxr-xr-xtests/btrfs/22517
-rwxr-xr-xtests/btrfs/22622
-rwxr-xr-xtests/btrfs/22714
-rwxr-xr-xtests/btrfs/22822
-rwxr-xr-xtests/btrfs/22914
-rwxr-xr-xtests/btrfs/23024
-rwxr-xr-xtests/btrfs/23114
-rwxr-xr-xtests/btrfs/23222
-rwxr-xr-xtests/btrfs/23314
-rwxr-xr-xtests/btrfs/23420
-rwxr-xr-xtests/btrfs/23514
-rwxr-xr-xtests/btrfs/23614
-rwxr-xr-xtests/btrfs/23722
-rwxr-xr-xtests/btrfs/23824
-rwxr-xr-xtests/btrfs/23914
-rwxr-xr-xtests/btrfs/24015
-rwxr-xr-xtests/btrfs/24114
241 files changed, 848 insertions, 3526 deletions
diff --git a/tests/btrfs/001 b/tests/btrfs/001
index fb051e8a..000aeb34 100755
--- a/tests/btrfs/001
+++ b/tests/btrfs/001
@@ -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
diff --git a/tests/btrfs/002 b/tests/btrfs/002
index 66775562..58f0cdcd 100755
--- a/tests/btrfs/002
+++ b/tests/btrfs/002
@@ -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
diff --git a/tests/btrfs/003 b/tests/btrfs/003
index fbb313fb..d241ec6e 100755
--- a/tests/btrfs/003
+++ b/tests/btrfs/003
@@ -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()
{
diff --git a/tests/btrfs/004 b/tests/btrfs/004
index 0458d2b6..4e767a2f 100755
--- a/tests/btrfs/004
+++ b/tests/btrfs/004
@@ -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;
diff --git a/tests/btrfs/005 b/tests/btrfs/005
index ff20a638..878a8c7c 100755
--- a/tests/btrfs/005
+++ b/tests/btrfs/005
@@ -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
diff --git a/tests/btrfs/006 b/tests/btrfs/006
index 8168992f..fd0f89e2 100755
--- a/tests/btrfs/006
+++ b/tests/btrfs/006
@@ -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`
diff --git a/tests/btrfs/007 b/tests/btrfs/007
index 4d25dcc2..ed7d143a 100755
--- a/tests/btrfs/007
+++ b/tests/btrfs/007
@@ -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
diff --git a/tests/btrfs/008 b/tests/btrfs/008
index 94e4fe09..438cec82 100755
--- a/tests/btrfs/008
+++ b/tests/btrfs/008
@@ -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
diff --git a/tests/btrfs/009 b/tests/btrfs/009
index 964c8324..be7e2f02 100755
--- a/tests/btrfs/009
+++ b/tests/btrfs/009
@@ -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
diff --git a/tests/btrfs/010 b/tests/btrfs/010
index d963311e..10693901 100755
--- a/tests/btrfs/010
+++ b/tests/btrfs/010
@@ -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
diff --git a/tests/btrfs/011 b/tests/btrfs/011
index f96d11ce..f5d865ab 100755
--- a/tests/btrfs/011
+++ b/tests/btrfs/011
@@ -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"
diff --git a/tests/btrfs/012 b/tests/btrfs/012
index 0feca7d9..46341e98 100755
--- a/tests/btrfs/012
+++ b/tests/btrfs/012
@@ -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"
-
-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/preamble
+_begin_fstest auto convert
+
+# 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
diff --git a/tests/btrfs/013 b/tests/btrfs/013
index 5e03ed4a..1335b8cb 100755
--- a/tests/btrfs/013
+++ b/tests/btrfs/013
@@ -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
diff --git a/tests/btrfs/014 b/tests/btrfs/014
index 97977198..9e236274 100755
--- a/tests/btrfs/014
+++ b/tests/btrfs/014
@@ -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
diff --git a/tests/btrfs/015 b/tests/btrfs/015
index b51c39a0..7398f9bf 100755
--- a/tests/btrfs/015
+++ b/tests/btrfs/015
@@ -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
diff --git a/tests/btrfs/016 b/tests/btrfs/016
index 015ec17f..6d05da54 100755
--- a/tests/btrfs/016
+++ b/tests/btrfs/016
@@ -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
diff --git a/tests/btrfs/017 b/tests/btrfs/017
index 1e886054..62207101 100755
--- a/tests/btrfs/017
+++ b/tests/btrfs/017
@@ -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
diff --git a/tests/btrfs/018 b/tests/btrfs/018
index 96ae46ed..c522e207 100755
--- a/tests/btrfs/018
+++ b/tests/btrfs/018
@@ -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 \
diff --git a/tests/btrfs/019 b/tests/btrfs/019
index 817a6b1b..a5b590d3 100755
--- a/tests/btrfs/019
+++ b/tests/btrfs/019
@@ -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
diff --git a/tests/btrfs/020 b/tests/btrfs/020
index 769e1776..ac876ea3 100755
--- a/tests/btrfs/020
+++ b/tests/btrfs/020
@@ -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
diff --git a/tests/btrfs/021 b/tests/btrfs/021
index 6362281c..5943da2f 100755
--- a/tests/btrfs/021
+++ b/tests/btrfs/021
@@ -9,23 +9,10 @@
# The test aims to trigger snapshot-aware defrag path in endio by
# running balance, which is not expected and leads to a crash.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick balance defrag
-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
@@ -45,8 +32,6 @@ run_test()
_supported_fs btrfs
_require_scratch
-rm -f $seqres.full
-
_scratch_mkfs > /dev/null 2>&1
_scratch_mount
diff --git a/tests/btrfs/022 b/tests/btrfs/022
index 5369cf85..bfd6ac7f 100755
--- a/tests/btrfs/022
+++ b/tests/btrfs/022
@@ -6,31 +6,16 @@
#
# Test the basic functionality of qgroups
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto qgroup limit
-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
_supported_fs btrfs
_require_scratch
_require_btrfs_qgroup_report
-rm -f $seqres.full
-
# Test to make sure we can actually turn it on and it makes sense
_basic_test()
{
diff --git a/tests/btrfs/023 b/tests/btrfs/023
index 847e26e6..f6c05b12 100755
--- a/tests/btrfs/023
+++ b/tests/btrfs/023
@@ -8,29 +8,15 @@
#
# The test aims to create the raid and verify that its created
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto
-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
_supported_fs btrfs
_require_scratch_dev_pool 4
-rm -f $seqres.full
create_group_profile()
{
diff --git a/tests/btrfs/024 b/tests/btrfs/024
index 8a3e433f..95c734ec 100755
--- a/tests/btrfs/024
+++ b/tests/btrfs/024
@@ -8,24 +8,10 @@
# the oops will happen when the users write some data into the files whose
# compress flag is set but the compression of the fs is disabled.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick compress
-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
diff --git a/tests/btrfs/025 b/tests/btrfs/025
index 5c814055..b9ffd8cc 100755
--- a/tests/btrfs/025
+++ b/tests/btrfs/025
@@ -10,22 +10,18 @@
# to the ioctl clone API, which would return -EINVAL errors to btrfs receive,
# causing the receive command to abort immediately.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick send clone
tmp=`mktemp -d`
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
+# Override the default cleanup function.
_cleanup()
{
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -33,8 +29,6 @@ _supported_fs btrfs
_require_scratch
_require_xfs_io_command "falloc"
-rm -f $seqres.full
-
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
diff --git a/tests/btrfs/026 b/tests/btrfs/026
index d8239d51..ddd093b8 100755
--- a/tests/btrfs/026
+++ b/tests/btrfs/026
@@ -7,21 +7,10 @@
# Test that doing a direct IO write against a file range that contains one
# prealloc extent and one compressed extent works correctly.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick compress prealloc
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -29,8 +18,6 @@ _supported_fs btrfs
_require_scratch
_require_xfs_io_command "falloc"
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount "-o compress"
diff --git a/tests/btrfs/027 b/tests/btrfs/027
index 30f2437f..e8679248 100755
--- a/tests/btrfs/027
+++ b/tests/btrfs/027
@@ -6,28 +6,12 @@
#
# Test replace of a missing device on various data and metadata profiles.
#
-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 # 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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
diff --git a/tests/btrfs/028 b/tests/btrfs/028
index c2ffee36..fe0678f8 100755
--- a/tests/btrfs/028
+++ b/tests/btrfs/028
@@ -10,28 +10,12 @@
# Although current qgroup can handle it, we still need to prevent any
# regression which may break current qgroup.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto qgroup balance
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_scratch
diff --git a/tests/btrfs/029 b/tests/btrfs/029
index 0234a7f0..1bdbc951 100755
--- a/tests/btrfs/029
+++ b/tests/btrfs/029
@@ -14,23 +14,10 @@
# - Copy a file with the reflink=always option. Should result in
# error.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick clone
-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
. ./common/reflink
@@ -45,8 +32,6 @@ reflink_test_dir=$TEST_DIR/test-$seq
rm -rf $reflink_test_dir
mkdir $reflink_test_dir
-rm -f $seqres.full
-
_scratch_mkfs > /dev/null 2>&1
_scratch_mount
$XFS_IO_PROG -f -c 'pwrite -S 0x61 0 9000' $SCRATCH_MNT/original >> $seqres.full
diff --git a/tests/btrfs/030 b/tests/btrfs/030
index bb10a5d1..bce5ba1e 100755
--- a/tests/btrfs/030
+++ b/tests/btrfs/030
@@ -17,21 +17,18 @@
# used while building path strings until a krealloc was unable to allocate
# more memory, which caused a warning dump in dmesg.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick send
tmp=`mktemp -d`
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+# Override the default cleanup function.
_cleanup()
{
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -39,12 +36,9 @@ _supported_fs btrfs
_require_scratch
_require_fssum
-rm -f $seqres.full
-
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
-
mkdir -p $SCRATCH_MNT/a/b/c
echo "hello" > $SCRATCH_MNT/a/b/c/file.txt
mkdir $SCRATCH_MNT/a/b/c/d
diff --git a/tests/btrfs/031 b/tests/btrfs/031
index d950c86d..b0796bae 100755
--- a/tests/btrfs/031
+++ b/tests/btrfs/031
@@ -11,23 +11,10 @@
# - Change one original and two reflinked files
# - Move reflinked files between subvolumes
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick subvol clone
-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
. ./common/reflink
@@ -54,8 +41,6 @@ subvol1=$SCRATCH_MNT/subvol-$seq-1
subvol2=$SCRATCH_MNT/subvol-$seq-2
cross_mount_test_dir=$TEST_DIR/test-$seq
-rm -f $seqres.full
-
_scratch_mkfs > /dev/null 2>&1
_scratch_mount
diff --git a/tests/btrfs/032 b/tests/btrfs/032
index 3665a2cd..502a523b 100755
--- a/tests/btrfs/032
+++ b/tests/btrfs/032
@@ -7,23 +7,10 @@
# Regression test for transaction abortion when remounting RW to RO
# with flushoncommit option enabled.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick remount
-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
diff --git a/tests/btrfs/033 b/tests/btrfs/033
index d1f8a4db..50ec5856 100755
--- a/tests/btrfs/033
+++ b/tests/btrfs/033
@@ -6,28 +6,12 @@
#
# Regression test for iterating backrefs
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick send 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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_scratch
diff --git a/tests/btrfs/034 b/tests/btrfs/034
index 07c84c34..92ad5c38 100755
--- a/tests/btrfs/034
+++ b/tests/btrfs/034
@@ -7,22 +7,18 @@
# Test for a btrfs incremental send data corruption issue due to
# bad detection of file holes.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick send
tmp=`mktemp -d`
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
+# Override the default cleanup function.
_cleanup()
{
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -30,8 +26,6 @@ _supported_fs btrfs
_require_scratch
_require_xfs_io_command "falloc"
-rm -f $seqres.full
-
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
diff --git a/tests/btrfs/035 b/tests/btrfs/035
index a772650f..4ddc5bf6 100755
--- a/tests/btrfs/035
+++ b/tests/btrfs/035
@@ -6,23 +6,10 @@
#
# Regression test for overwriting clones
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick clone
-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
diff --git a/tests/btrfs/036 b/tests/btrfs/036
index 36b652fd..c3d13da2 100755
--- a/tests/btrfs/036
+++ b/tests/btrfs/036
@@ -6,15 +6,12 @@
#
# Regression test for running snapshots and send concurrently.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick send snapshot
-here=`pwd`
-tmp=/tmp/$$
-status=1 # failure is the default!
snapshots_pid=0
+# Override the default cleanup function.
_cleanup()
{
# kill backgroud snapshots
@@ -43,15 +40,9 @@ do_snapshots()
done
}
-trap "_cleanup ; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_scratch
diff --git a/tests/btrfs/037 b/tests/btrfs/037
index 9ef199a9..9ea43358 100755
--- a/tests/btrfs/037
+++ b/tests/btrfs/037
@@ -14,22 +14,18 @@
#
# Btrfs: fix data corruption when reading/updating compressed extents
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick compress
tmp=`mktemp -d`
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
+# Override the default cleanup function.
_cleanup()
{
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -37,8 +33,6 @@ _supported_fs btrfs
_require_scratch
_require_xfs_io_command "falloc"
-rm -f $seqres.full
-
_scratch_mkfs >/dev/null 2>&1
_scratch_mount "-o compress-force=lzo"
diff --git a/tests/btrfs/038 b/tests/btrfs/038
index 4e24f236..13e50701 100755
--- a/tests/btrfs/038
+++ b/tests/btrfs/038
@@ -13,21 +13,18 @@
#
# Btrfs: use right clone root offset for compressed extents
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick compress send
tmp=`mktemp -d`
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+# Override the default cleanup function.
_cleanup()
{
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -35,8 +32,6 @@ _supported_fs btrfs
_require_scratch
_require_fssum
-rm -f $seqres.full
-
_scratch_mkfs >/dev/null 2>&1
_scratch_mount "-o compress-force=lzo"
diff --git a/tests/btrfs/039 b/tests/btrfs/039
index 46d27037..c2d7c20c 100755
--- a/tests/btrfs/039
+++ b/tests/btrfs/039
@@ -16,21 +16,18 @@
#
# Btrfs: incremental send, fix invalid path after dir rename
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick send
tmp=`mktemp -d`
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+# Override the default cleanup function.
_cleanup()
{
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -38,8 +35,6 @@ _supported_fs btrfs
_require_scratch
_require_fssum
-rm -f $seqres.full
-
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
diff --git a/tests/btrfs/040 b/tests/btrfs/040
index 90ecdbe3..35bd12cd 100755
--- a/tests/btrfs/040
+++ b/tests/btrfs/040
@@ -16,21 +16,18 @@
#
# Btrfs: send, don't send rmdir for same target multiple times
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick send
tmp=`mktemp -d`
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+# Override the default cleanup function.
_cleanup()
{
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -38,8 +35,6 @@ _supported_fs btrfs
_require_scratch
_require_fssum
-rm -f $seqres.full
-
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
diff --git a/tests/btrfs/041 b/tests/btrfs/041
index 89ab4e1b..5b457764 100755
--- a/tests/btrfs/041
+++ b/tests/btrfs/041
@@ -12,25 +12,19 @@
#
# Btrfs-progs: fix restore of files with compressed extents
#
-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 quick compress
restore_dir=$TEST_DIR/btrfs-test-$seq
+# Override the default cleanup function.
_cleanup()
{
rm -fr $tmp
rm -fr $restore_dir
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -38,7 +32,6 @@ _supported_fs btrfs
_require_test
_require_scratch
-rm -f $seqres.full
mkdir $restore_dir
test_btrfs_restore()
diff --git a/tests/btrfs/042 b/tests/btrfs/042
index 7569530a..230f8fc0 100755
--- a/tests/btrfs/042
+++ b/tests/btrfs/042
@@ -6,31 +6,16 @@
#
# Test the basic functionality of Quota groups
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick qgroup limit
-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
_supported_fs btrfs
_require_scratch
_require_btrfs_qgroup_report
-rm -f $seqres.full
-
run_check _scratch_mkfs
_scratch_mount
diff --git a/tests/btrfs/043 b/tests/btrfs/043
index 2eddbde1..14b7cb71 100755
--- a/tests/btrfs/043
+++ b/tests/btrfs/043
@@ -12,21 +12,18 @@
#
# Btrfs: fix send attempting to rmdir non-empty directories
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick send
tmp=`mktemp -d`
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+# Override the default cleanup function.
_cleanup()
{
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -34,8 +31,6 @@ _supported_fs btrfs
_require_scratch
_require_fssum
-rm -f $seqres.full
-
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
diff --git a/tests/btrfs/044 b/tests/btrfs/044
index 069c3bdf..0864d040 100755
--- a/tests/btrfs/044
+++ b/tests/btrfs/044
@@ -17,21 +17,18 @@
#
# Btrfs: fix send issuing outdated paths for utimes, chown and chmod
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick send
tmp=`mktemp -d`
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+# Override the default cleanup function.
_cleanup()
{
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -39,8 +36,6 @@ _supported_fs btrfs
_require_scratch
_require_fssum
-rm -f $seqres.full
-
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
diff --git a/tests/btrfs/045 b/tests/btrfs/045
index a929bf91..9b23730b 100755
--- a/tests/btrfs/045
+++ b/tests/btrfs/045
@@ -33,21 +33,18 @@
# Btrfs: send, fix more issues related to directory renames
# Btrfs: send, account for orphan directories when building path strings
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick send
tmp=`mktemp -d`
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+# Override the default cleanup function.
_cleanup()
{
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -55,8 +52,6 @@ _supported_fs btrfs
_require_scratch
_require_fssum
-rm -f $seqres.full
-
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
diff --git a/tests/btrfs/046 b/tests/btrfs/046
index a1d82e1c..f654adae 100755
--- a/tests/btrfs/046
+++ b/tests/btrfs/046
@@ -13,24 +13,21 @@
#
# Btrfs: send, fix data corruption due to incorrect hole detection
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick send
tmp=`mktemp -d`
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
send_files_dir=$TEST_DIR/btrfs-test-$seq
+# Override the default cleanup function.
_cleanup()
{
rm -fr $send_files_dir
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -40,7 +37,6 @@ _require_scratch
_require_xfs_io_command "falloc"
_require_fssum
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/047 b/tests/btrfs/047
index 099ec24f..ac79b9f1 100755
--- a/tests/btrfs/047
+++ b/tests/btrfs/047
@@ -7,29 +7,13 @@
# Test that we can't set xattrs on subvolume placeholder directories.
# Regression test for Btrfs: disable xattr operations on subvolume directories.
#
-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/preamble
+_begin_fstest auto quick snapshot attr
+
+# Import common functions.
. ./common/filter
. ./common/attr
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
diff --git a/tests/btrfs/048 b/tests/btrfs/048
index 222d7026..93d4a171 100755
--- a/tests/btrfs/048
+++ b/tests/btrfs/048
@@ -10,24 +10,17 @@
# btrfs: fix vanished compression property after failed set
# btrfs: fix zstd compression parameter
#
-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 quick
+# Override the default cleanup function.
_cleanup()
{
rm -fr $send_files_dir
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/filter.btrfs
@@ -40,7 +33,6 @@ _require_btrfs_command inspect-internal dump-super
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/049 b/tests/btrfs/049
index e154a005..ad4ef122 100755
--- a/tests/btrfs/049
+++ b/tests/btrfs/049
@@ -9,24 +9,17 @@
#
# Btrfs: fix inode caching vs tree log
#
-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 quick
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
rm -rf $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmflakey
@@ -35,8 +28,6 @@ _supported_fs btrfs
_require_scratch
_require_dm_target flakey
-rm -f $seqres.full
-
_scratch_mkfs >> $seqres.full 2>&1
SAVE_MOUNT_OPTIONS="$MOUNT_OPTIONS"
diff --git a/tests/btrfs/050 b/tests/btrfs/050
index 50c12c55..ef1b3139 100755
--- a/tests/btrfs/050
+++ b/tests/btrfs/050
@@ -15,22 +15,17 @@
#
# Btrfs: send, fix incorrect ref access when using extrefs
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
rm -fr $send_files_dir
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -41,7 +36,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/051 b/tests/btrfs/051
index df3875ff..f0ac86aa 100755
--- a/tests/btrfs/051
+++ b/tests/btrfs/051
@@ -12,22 +12,17 @@
#
# Btrfs: send, fix corrupted path strings for long paths
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
rm -fr $send_files_dir
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -38,7 +33,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/052 b/tests/btrfs/052
index 37643036..4408de21 100755
--- a/tests/btrfs/052
+++ b/tests/btrfs/052
@@ -8,21 +8,16 @@
# file as a source and target. That is, clone extents within the same
# file.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick clone
+# Override the default cleanup function.
_cleanup()
{
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -30,8 +25,6 @@ _supported_fs btrfs
_require_scratch
_require_cloner
-rm -f $seqres.full
-
test_btrfs_clone_same_file()
{
if [ -z $1 ]; then
diff --git a/tests/btrfs/053 b/tests/btrfs/053
index 2bb0ea82..fbd2e7d9 100755
--- a/tests/btrfs/053
+++ b/tests/btrfs/053
@@ -13,22 +13,17 @@
#
# Btrfs: send, use the right limits for xattr names and values
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
rm -fr $send_files_dir
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/attr
@@ -46,7 +41,6 @@ leaf_size=$(echo -e "16384\n`getconf PAGE_SIZE`" | sort -nr | head -1)
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/054 b/tests/btrfs/054
index 6f7a9999..f1b5b2c3 100755
--- a/tests/btrfs/054
+++ b/tests/btrfs/054
@@ -21,22 +21,17 @@
# Btrfs: send, don't error in the presence of subvols/snapshots
# Btrfs: set dead flag on the right root when destroying snapshot
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
rm -fr $send_files_dir
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/attr
@@ -47,7 +42,6 @@ _require_scratch
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/055 b/tests/btrfs/055
index e3355da3..e538636d 100755
--- a/tests/btrfs/055
+++ b/tests/btrfs/055
@@ -12,21 +12,16 @@
#
# Btrfs: fix clone to deal with holes when NO_HOLES feature is enabled
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick clone
+# Override the default cleanup function.
_cleanup()
{
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -36,8 +31,6 @@ _require_cloner
_require_btrfs_fs_feature "no_holes"
_require_btrfs_mkfs_feature "no-holes"
-rm -f $seqres.full
-
test_btrfs_clone_with_holes()
{
_scratch_mkfs "$1" >/dev/null 2>&1
diff --git a/tests/btrfs/056 b/tests/btrfs/056
index bcf34d8d..e5ac516d 100755
--- a/tests/btrfs/056
+++ b/tests/btrfs/056
@@ -14,22 +14,17 @@
#
# Btrfs: make fsync work after cloning into a file
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick clone log
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmflakey
@@ -41,8 +36,6 @@ _require_btrfs_fs_feature "no_holes"
_require_btrfs_mkfs_feature "no-holes"
_require_dm_target flakey
-rm -f $seqres.full
-
test_btrfs_clone_fsync_log_recover()
{
_scratch_mkfs "$1" >/dev/null 2>&1
diff --git a/tests/btrfs/057 b/tests/btrfs/057
index bf9ab14a..074ac96a 100755
--- a/tests/btrfs/057
+++ b/tests/btrfs/057
@@ -6,31 +6,16 @@
#
# Quota rescan stress test, we run fsstress and quota rescan concurrently
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1
-
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common/rc
+. ./common/preamble
+_begin_fstest auto quick
+
+# Import common functions.
. ./common/filter
# real QA test starts here
_supported_fs btrfs
_require_scratch
-rm -f $seqres.full
-
run_check _scratch_mkfs "-b 1g"
_scratch_mount
diff --git a/tests/btrfs/058 b/tests/btrfs/058
index 96349f5a..493f2c54 100755
--- a/tests/btrfs/058
+++ b/tests/btrfs/058
@@ -13,14 +13,10 @@
#
# Btrfs: update commit root on snapshot creation after orphan cleanup
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send snapshot
+# Override the default cleanup function.
_cleanup()
{
if [ ! -z $XFS_IO_PID ]; then
@@ -29,8 +25,7 @@ _cleanup()
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -38,8 +33,6 @@ _supported_fs btrfs
_require_scratch
_require_xfs_io_command "-T"
-rm -f $seqres.full
-
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
diff --git a/tests/btrfs/059 b/tests/btrfs/059
index af84f971..d2ced0ae 100755
--- a/tests/btrfs/059
+++ b/tests/btrfs/059
@@ -10,23 +10,16 @@
#
# Btrfs: add missing compression property remove in btrfs_ioctl_setflags
#
-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 quick
+# Override the default cleanup function.
_cleanup()
{
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/filter.btrfs
@@ -36,8 +29,6 @@ _require_test
_require_scratch
_require_btrfs_command "property"
-rm -f $seqres.full
-
_scratch_mkfs >> $seqres.full 2>&1
_scratch_mount
diff --git a/tests/btrfs/060 b/tests/btrfs/060
index 6e026a5d..26db8a9b 100755
--- a/tests/btrfs/060
+++ b/tests/btrfs/060
@@ -7,23 +7,10 @@
# Run btrfs balance and subvolume create/mount/umount/delete simultaneously,
# with fsstress running in background.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto balance subvol
-here=`pwd`
-tmp=/tmp/$$
-status=1
-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
@@ -33,8 +20,6 @@ _require_scratch_nocheck
_require_scratch_dev_pool 4
_btrfs_get_profile_configs
-rm -f $seqres.full
-
run_test()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/061 b/tests/btrfs/061
index 97420335..55f5625b 100755
--- a/tests/btrfs/061
+++ b/tests/btrfs/061
@@ -7,23 +7,10 @@
# Run btrfs balance and scrub operations simultaneously with fsstress
# running in background.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto balance scrub
-here=`pwd`
-tmp=/tmp/$$
-status=1
-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
@@ -33,8 +20,6 @@ _require_scratch_nocheck
_require_scratch_dev_pool 4
_btrfs_get_profile_configs
-rm -f $seqres.full
-
run_test()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/062 b/tests/btrfs/062
index f27f22ac..47b0b937 100755
--- a/tests/btrfs/062
+++ b/tests/btrfs/062
@@ -7,23 +7,10 @@
# Run btrfs balance and defrag operations simultaneously with fsstress
# running in background.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto balance defrag compress
-here=`pwd`
-tmp=/tmp/$$
-status=1
-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
@@ -33,8 +20,6 @@ _require_scratch_nocheck
_require_scratch_dev_pool 4
_btrfs_get_profile_configs
-rm -f $seqres.full
-
run_test()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/063 b/tests/btrfs/063
index e34d1b57..c96390b9 100755
--- a/tests/btrfs/063
+++ b/tests/btrfs/063
@@ -7,23 +7,10 @@
# Run btrfs balance and remount with different compress algorithms
# simultaneously, with fsstress running in background.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto balance remount compress
-here=`pwd`
-tmp=/tmp/$$
-status=1
-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
@@ -33,8 +20,6 @@ _require_scratch_nocheck
_require_scratch_dev_pool 4
_btrfs_get_profile_configs
-rm -f $seqres.full
-
run_test()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/064 b/tests/btrfs/064
index ce73acf7..74116188 100755
--- a/tests/btrfs/064
+++ b/tests/btrfs/064
@@ -9,23 +9,10 @@
# Balance and replace operations are mutually exclusive operations they can't
# run simultaneously. One of them is expected to fail when the other is running.
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto balance replace volume
-here=`pwd`
-tmp=/tmp/$$
-status=1
-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
@@ -36,8 +23,6 @@ _require_scratch_dev_pool 5
_require_scratch_dev_pool_equal_size
_btrfs_get_profile_configs replace
-rm -f $seqres.full
-
run_test()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/065 b/tests/btrfs/065
index 6994b2c4..4ebf9326 100755
--- a/tests/btrfs/065
+++ b/tests/btrfs/065
@@ -7,23 +7,10 @@
# Run btrfs subvolume create/mount/umount/delete and device replace
# operation simultaneously, with fsstress running in background.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto subvol replace volume
-here=`pwd`
-tmp=/tmp/$$
-status=1
-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
@@ -34,8 +21,6 @@ _require_scratch_dev_pool 5
_require_scratch_dev_pool_equal_size
_btrfs_get_profile_configs replace
-rm -f $seqres.full
-
run_test()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/066 b/tests/btrfs/066
index cd9aad9c..8d12af61 100755
--- a/tests/btrfs/066
+++ b/tests/btrfs/066
@@ -7,23 +7,10 @@
# Run btrfs subvolume create/mount/umount/delete and btrfs scrub
# operation simultaneously, with fsstress running in background.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto subvol scrub
-here=`pwd`
-tmp=/tmp/$$
-status=1
-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
@@ -33,8 +20,6 @@ _require_scratch_nocheck
_require_scratch_dev_pool 4
_btrfs_get_profile_configs
-rm -f $seqres.full
-
run_test()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/067 b/tests/btrfs/067
index ed4cef91..44803f9f 100755
--- a/tests/btrfs/067
+++ b/tests/btrfs/067
@@ -7,23 +7,10 @@
# Run btrfs subvolume create/mount/umount/delete and btrfs defrag
# operation simultaneously, with fsstress running in background.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto subvol defrag compress
-here=`pwd`
-tmp=/tmp/$$
-status=1
-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
@@ -33,8 +20,6 @@ _require_scratch_nocheck
_require_scratch_dev_pool 4
_btrfs_get_profile_configs
-rm -f $seqres.full
-
run_test()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/068 b/tests/btrfs/068
index 600ba40e..e03a4891 100755
--- a/tests/btrfs/068
+++ b/tests/btrfs/068
@@ -8,23 +8,10 @@
# different compress algorithms simultaneously, with fsstress running
# in background.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto subvol remount compress
-here=`pwd`
-tmp=/tmp/$$
-status=1
-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
@@ -34,8 +21,6 @@ _require_scratch_nocheck
_require_scratch_dev_pool 4
_btrfs_get_profile_configs
-rm -f $seqres.full
-
run_test()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/069 b/tests/btrfs/069
index 924e5b5d..6e798a2e 100755
--- a/tests/btrfs/069
+++ b/tests/btrfs/069
@@ -7,23 +7,10 @@
# Run btrfs replace operations and scrub simultaneously with fsstress
# running in background.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto replace scrub volume
-here=`pwd`
-tmp=/tmp/$$
-status=1
-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
@@ -34,8 +21,6 @@ _require_scratch_dev_pool 5
_require_scratch_dev_pool_equal_size
_btrfs_get_profile_configs replace
-rm -f $seqres.full
-
run_test()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/070 b/tests/btrfs/070
index 7c6215b1..dcf978b3 100755
--- a/tests/btrfs/070
+++ b/tests/btrfs/070
@@ -7,23 +7,10 @@
# Run btrfs replace operations and defrag simultaneously with fsstress
# running in background.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto replace defrag compress volume
-here=`pwd`
-tmp=/tmp/$$
-status=1
-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
@@ -34,8 +21,6 @@ _require_scratch_dev_pool 5
_require_scratch_dev_pool_equal_size
_btrfs_get_profile_configs replace
-rm -f $seqres.full
-
run_test()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/071 b/tests/btrfs/071
index 4f5d531b..cd1de264 100755
--- a/tests/btrfs/071
+++ b/tests/btrfs/071
@@ -7,23 +7,10 @@
# Run btrfs replace operations and remount with different compress
# algorithms simultaneously with fsstress running in background.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto replace remount compress volume
-here=`pwd`
-tmp=/tmp/$$
-status=1
-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
@@ -34,8 +21,6 @@ _require_scratch_dev_pool 5
_require_scratch_dev_pool_equal_size
_btrfs_get_profile_configs replace
-rm -f $seqres.full
-
run_test()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/072 b/tests/btrfs/072
index c96a0a7a..bcb0ea25 100755
--- a/tests/btrfs/072
+++ b/tests/btrfs/072
@@ -7,23 +7,10 @@
# Run btrfs scrub and defrag operations simultaneously with fsstress
# running in background.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto scrub defrag compress
-here=`pwd`
-tmp=/tmp/$$
-status=1
-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
@@ -33,8 +20,6 @@ _require_scratch_nocheck
_require_scratch_dev_pool 4
_btrfs_get_profile_configs
-rm -f $seqres.full
-
run_test()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/073 b/tests/btrfs/073
index 18e3d43a..26c5deb6 100755
--- a/tests/btrfs/073
+++ b/tests/btrfs/073
@@ -7,23 +7,10 @@
# Run btrfs scrub and remount with different compress algorithms
# simultaneously with fsstress running in background.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto scrub remount compress
-here=`pwd`
-tmp=/tmp/$$
-status=1
-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
@@ -33,8 +20,6 @@ _require_scratch_nocheck
_require_scratch_dev_pool 4
_btrfs_get_profile_configs
-rm -f $seqres.full
-
run_test()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/074 b/tests/btrfs/074
index c894e23a..dc26d8c0 100755
--- a/tests/btrfs/074
+++ b/tests/btrfs/074
@@ -7,23 +7,10 @@
# Run btrfs defrag operations and remount with different compress algorithms
# simultaneously with fsstress running in background.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto defrag remount compress
-here=`pwd`
-tmp=/tmp/$$
-status=1
-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
@@ -33,8 +20,6 @@ _require_scratch_nocheck
_require_scratch_dev_pool 4
_btrfs_get_profile_configs
-rm -f $seqres.full
-
run_test()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/075 b/tests/btrfs/075
index 24c3c0f2..e10d6562 100755
--- a/tests/btrfs/075
+++ b/tests/btrfs/075
@@ -7,15 +7,10 @@
# If one subvolume was mounted with selinux context, other subvolumes
# should be able to be mounted with the same selinux context too.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick subvol
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -23,8 +18,7 @@ _cleanup()
$UMOUNT_PROG $subvol_mnt >/dev/null 2>&1
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -36,7 +30,6 @@ if [ "$SELINUX_MOUNT_OPTIONS" == "" ]; then
_notrun "Require selinux to be enabled"
fi
-rm -f $seqres.full
echo "Silence is golden"
# first mount default subvolume with selinux context set
diff --git a/tests/btrfs/076 b/tests/btrfs/076
index 7bca7af3..89e9672d 100755
--- a/tests/btrfs/076
+++ b/tests/btrfs/076
@@ -9,24 +9,17 @@
#
# Btrfs: fix incorrect compression ratio detection
#
-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 quick compress
+# Override the default cleanup function.
_cleanup()
{
cd /
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/defrag
@@ -35,8 +28,6 @@ _supported_fs btrfs
_require_test
_require_scratch
-rm -f $seqres.full
-
_scratch_mkfs >> $seqres.full 2>&1
_scratch_mount "-o compress=lzo"
diff --git a/tests/btrfs/077 b/tests/btrfs/077
index f2dbf4ab..4cfd6ed7 100755
--- a/tests/btrfs/077
+++ b/tests/btrfs/077
@@ -19,22 +19,19 @@
#
# Btrfs: send, don't delay dir move if there's a new parent inode
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick send snapshot
tmp=`mktemp -d`
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+# Override the default cleanup function.
_cleanup()
{
rm -fr $send_files_dir
rm -fr $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -44,7 +41,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/078 b/tests/btrfs/078
index 43f3315e..bdd7e04e 100755
--- a/tests/btrfs/078
+++ b/tests/btrfs/078
@@ -13,29 +13,24 @@
# Btrfs: race free update of commit root for ro snapshots
# 9c3b306e1c9e6be4be09e99a8fe2227d1005effc
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto snapshot
tmp=`mktemp -d`
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+# Override the default cleanup function.
_cleanup()
{
rm -fr $tmp
}
-# 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
-
workout()
{
ops=$1
diff --git a/tests/btrfs/079 b/tests/btrfs/079
index 5b7d5668..1acd1855 100755
--- a/tests/btrfs/079
+++ b/tests/btrfs/079
@@ -17,14 +17,10 @@
# btrfs: Fix and enhance merge_extent_mapping() to insert best fitted extent map
# btrfs: Fix the wrong condition judgment about subset extent map
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto rw metadata
+# Override the default cleanup function.
_cleanup()
{
kill $dd_pid &> /dev/null
@@ -34,8 +30,7 @@ _cleanup()
rm -fr $tmp.* $tmp
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -51,8 +46,6 @@ buffersize=$((1024 * 1024)) # 1M bs for dd
count=$(($filesize / $buffersize))
testfile=$SCRATCH_MNT/testfile
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
_require_fs_space $SCRATCH_MNT $(($filesize / 1024))
diff --git a/tests/btrfs/080 b/tests/btrfs/080
index 94a133cb..45f5ad19 100755
--- a/tests/btrfs/080
+++ b/tests/btrfs/080
@@ -16,13 +16,10 @@
#
# Btrfs: fix snapshot inconsistency after a file write followed by truncate
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto snapshot
+# Override the default cleanup function.
_cleanup()
{
for p in ${cpu_stress_pids[*]}; do
@@ -31,16 +28,13 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
_supported_fs btrfs
_require_scratch_nocheck
-rm -f $seqres.full
-
create_snapshot()
{
local ts=`date +'%H_%M_%S_%N'`
diff --git a/tests/btrfs/081 b/tests/btrfs/081
index 0a46f594..65fed9a7 100755
--- a/tests/btrfs/081
+++ b/tests/btrfs/081
@@ -16,20 +16,10 @@
# Btrfs: ensure readers see new data after a clone operation
# (commit c125b8bff1d9f6c8c91ce4eb8bd5616058c7d510)
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- rm -f $tmp.*
-}
+. ./common/preamble
+_begin_fstest auto quick clone
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -37,8 +27,6 @@ _supported_fs btrfs
_require_scratch
_require_cloner
-rm -f $seqres.full
-
num_extents=100
extent_size=8192
diff --git a/tests/btrfs/082 b/tests/btrfs/082
index 8faa43ee..888464d3 100755
--- a/tests/btrfs/082
+++ b/tests/btrfs/082
@@ -15,23 +15,10 @@
# btrfs: fix crash in remount(thread_pool=) case
# 800ee2247f483b6d05ed47ef3bbc90b56451746c
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick remount
-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
diff --git a/tests/btrfs/083 b/tests/btrfs/083
index 821266b6..e09769dd 100755
--- a/tests/btrfs/083
+++ b/tests/btrfs/083
@@ -13,22 +13,17 @@
#
# Btrfs: incremental send, don't rename a directory too soon
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
rm -fr $send_files_dir
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -38,7 +33,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/084 b/tests/btrfs/084
index d216b2b9..04ccbb91 100755
--- a/tests/btrfs/084
+++ b/tests/btrfs/084
@@ -12,22 +12,17 @@
#
# Btrfs: incremental send, clear name from cache after orphanization
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
rm -fr $send_files_dir
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -37,7 +32,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/085 b/tests/btrfs/085
index 4622f208..cef4da28 100755
--- a/tests/btrfs/085
+++ b/tests/btrfs/085
@@ -13,24 +13,17 @@
# (i.e. btrfs subvol set-default)
# 3) Non-default subvolume lookup
#
-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 metadata subvol
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
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/dmflakey
@@ -40,8 +33,6 @@ _require_scratch
_require_dm_target flakey
_require_btrfs_command inspect-internal dump-tree
-rm -f $seqres.full
-
has_orphan_item()
{
INO=$1
diff --git a/tests/btrfs/086 b/tests/btrfs/086
index f67a06bf..8c1339ab 100755
--- a/tests/btrfs/086
+++ b/tests/btrfs/086
@@ -15,21 +15,10 @@
#
# Btrfs: fix inode eviction infinite loop after cloning into it
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick clone
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -37,8 +26,6 @@ _supported_fs btrfs
_require_scratch
_require_cloner
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
diff --git a/tests/btrfs/087 b/tests/btrfs/087
index a78b5976..59a775ef 100755
--- a/tests/btrfs/087
+++ b/tests/btrfs/087
@@ -18,22 +18,17 @@
#
# Btrfs: incremental send, don't delay directory renames unnecessarily
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
rm -fr $send_files_dir
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -43,7 +38,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/088 b/tests/btrfs/088
index 42982ece..d9c5528b 100755
--- a/tests/btrfs/088
+++ b/tests/btrfs/088
@@ -13,21 +13,10 @@
# Btrfs: fix fs corruption on transaction abort if device supports discard
# (commit 678886bdc6378c1cbd5072da2c5a3035000214e3)
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick metadata
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -52,8 +41,6 @@ disable_io_failure()
echo 0 > $DEBUGFS_MNT/fail_make_request/times
}
-rm -f $seqres.full
-
# We will abort a btrfs transaction later, which always produces a warning in
# dmesg. We do not want the test to fail because of this.
_disable_dmesg_check
diff --git a/tests/btrfs/089 b/tests/btrfs/089
index 468d6140..e0b61e8e 100755
--- a/tests/btrfs/089
+++ b/tests/btrfs/089
@@ -8,23 +8,10 @@
# not unmounted prematurely. This is a regression test for Linux commit "Btrfs:
# don't invalidate root dentry when subvolume deletion fails".
#
-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/preamble
+_begin_fstest auto quick subvol
+
+# Import common functions.
. ./common/filter
. ./common/filter.btrfs
@@ -34,8 +21,6 @@ _cleanup()
_supported_fs btrfs
_require_scratch
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
diff --git a/tests/btrfs/090 b/tests/btrfs/090
index 59567095..766c24cd 100755
--- a/tests/btrfs/090
+++ b/tests/btrfs/090
@@ -13,23 +13,10 @@
# btrfs-progs: Fix wrong return value when executing 'fi show' on
# umounted device.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick metadata
-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
@@ -39,8 +26,6 @@ _supported_fs btrfs
_require_scratch
_require_scratch_dev_pool
-rm -f $seqres.full
-
FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
TOTAL_DEVS=`echo $SCRATCH_DEV_POOL | wc -w`
diff --git a/tests/btrfs/091 b/tests/btrfs/091
index b8104429..307289b1 100755
--- a/tests/btrfs/091
+++ b/tests/btrfs/091
@@ -7,22 +7,10 @@
# Test for incorrect exclusive reference count after cloning file
# between subvolumes.
#
-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()
-{
- rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/reflink
@@ -32,8 +20,6 @@ _supported_fs btrfs
_require_scratch
_require_cp_reflink
-rm -f $seqres.full
-
# use largest node/leaf size (64K) to allow the test to be run on arch with
# page size > 4k.
NODESIZE=65536
diff --git a/tests/btrfs/092 b/tests/btrfs/092
index 4ab34681..f752f972 100755
--- a/tests/btrfs/092
+++ b/tests/btrfs/092
@@ -17,22 +17,17 @@
#
# Btrfs: incremental send, check if orphanized dir inode needs delayed rename
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
rm -fr $send_files_dir
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -42,7 +37,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/093 b/tests/btrfs/093
index d0e38f4c..f4ee873a 100755
--- a/tests/btrfs/093
+++ b/tests/btrfs/093
@@ -12,21 +12,10 @@
#
# Btrfs: fix range cloning when same inode used as source and destination
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick clone
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -34,8 +23,6 @@ _supported_fs btrfs
_require_scratch
_require_cloner
-rm -f $seqres.full
-
# Create a file with an extent layout that confused the btrfs clone ioctl
# implementation. The first extent item that is cloned by the second call
# to the cloner program will have only a trailing part of it referenced by
diff --git a/tests/btrfs/094 b/tests/btrfs/094
index a0230e65..e94cf17b 100755
--- a/tests/btrfs/094
+++ b/tests/btrfs/094
@@ -17,22 +17,17 @@
#
# Btrfs: incremental send, fix clone operations for compressed extents
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
rm -fr $send_files_dir
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -42,7 +37,6 @@ _require_cloner
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
@@ -67,7 +61,6 @@ $XFS_IO_PROG -f -c "pwrite -S 0xaa $((16 * $BLOCK_SIZE)) $((32 * $BLOCK_SIZE))"
$XFS_IO_PROG -c "pwrite -S 0xbb $((16 * $BLOCK_SIZE)) $((28 * $BLOCK_SIZE))" \
-c "fsync" $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
-
# Now rewrite the block range [45, 48[. This will make the inode's
# metadata continue to point the 32 block extent we created earlier,
# with a single extent item that points to it with a start offset
diff --git a/tests/btrfs/095 b/tests/btrfs/095
index 9e16073b..b3a5fc14 100755
--- a/tests/btrfs/095
+++ b/tests/btrfs/095
@@ -12,21 +12,17 @@
#
# The regression was introduced in the 4.2-rc1 Linux kernel.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick metadata log
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmflakey
@@ -37,8 +33,6 @@ _require_dm_target flakey
_require_cloner
_require_xfs_io_command "falloc"
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_require_metadata_journaling $SCRATCH_DEV
_init_flakey
@@ -103,7 +97,6 @@ $XFS_IO_PROG -c "pwrite -S 0xbb $((768 * $BLOCK_SIZE)) $((25 * $BLOCK_SIZE))" \
# The 25 blocks extent has a single back reference and it relates to file offset
# mapped by 768th block.
-
# Now clone our 25 block extent into offset mapped by 150th block. That offset
# covers the last 5 blocks of the prealloc extent, the whole 10 block extent and
# 10 blocks of the hole starting at offset mapped by 165th block.
diff --git a/tests/btrfs/096 b/tests/btrfs/096
index 5fcbdd7a..80818682 100755
--- a/tests/btrfs/096
+++ b/tests/btrfs/096
@@ -6,20 +6,10 @@
#
# Test that we can not clone an inline extent into a non-zero file offset.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick clone
-_cleanup()
-{
- rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/filter.btrfs
@@ -28,8 +18,6 @@ _supported_fs btrfs
_require_scratch
_require_cloner
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
diff --git a/tests/btrfs/097 b/tests/btrfs/097
index 576c45d1..16ed7e00 100755
--- a/tests/btrfs/097
+++ b/tests/btrfs/097
@@ -7,22 +7,17 @@
# Test that an incremental send works after a file gets one of its extents
# cloned/deduplicated into lower file offsets.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send clone
+# Override the default cleanup function.
_cleanup()
{
rm -fr $send_files_dir
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -32,7 +27,6 @@ _require_cloner
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/098 b/tests/btrfs/098
index b81daefb..d4e9f43d 100755
--- a/tests/btrfs/098
+++ b/tests/btrfs/098
@@ -8,21 +8,17 @@
# lower file offset, after a power failure our file has the same content it
# had before the power failure and after the extent cloning operation.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick metadata clone log
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmflakey
@@ -32,8 +28,6 @@ _require_scratch
_require_dm_target flakey
_require_cloner
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_require_metadata_journaling $SCRATCH_DEV
_init_flakey
@@ -51,7 +45,6 @@ $XFS_IO_PROG -f -c "pwrite -S 0xaa $((200 * $BLOCK_SIZE)) $((25 * $BLOCK_SIZE))"
-c "fsync" \
$SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
-
# Now clone part of our extent into file offset mapped by 100th block. This adds
# a file extent item to our inode's metadata that points to the 25 block extent
# we created before, using a data offset of 5 blocks and a data length of 5
diff --git a/tests/btrfs/099 b/tests/btrfs/099
index dafc7c4d..375cc2b9 100755
--- a/tests/btrfs/099
+++ b/tests/btrfs/099
@@ -7,23 +7,10 @@
# Check for qgroup reserved space leaks caused by re-writing dirty ranges
# This bug has been present in btrfs qgroup for a long time
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick qgroup limit
-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 @@ _require_btrfs_qgroup_report
BLOCKSIZE=$(( 2 * 1024 * 1024 )) # 2M block size
FILESIZE=$(( 128 * 1024 * 1024 )) # 128M file size
-rm -f $seqres.full
-
_scratch_mkfs >> $seqres.full 2>&1
_scratch_mount
_require_fs_space $SCRATCH_MNT $(($FILESIZE * 2 / 1024))
diff --git a/tests/btrfs/100 b/tests/btrfs/100
index ea08b96e..9986a06e 100755
--- a/tests/btrfs/100
+++ b/tests/btrfs/100
@@ -7,25 +7,17 @@
# Test device replace works when the source device has EIO
#
#
-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 replace volume eio
+# Override the default cleanup function.
_cleanup()
{
_dmerror_cleanup
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/filter.btrfs
. ./common/dmerror
@@ -34,8 +26,6 @@ _supported_fs btrfs
_require_scratch_dev_pool 3
_require_dm_target error
-rm -f $seqres.full
-
dev1="`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}'`"
dev2="`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $3}'`"
diff --git a/tests/btrfs/101 b/tests/btrfs/101
index 0791def2..f0436f9f 100755
--- a/tests/btrfs/101
+++ b/tests/btrfs/101
@@ -7,25 +7,17 @@
# Test device delete when the source device has EIO
#
#
-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 replace volume eio
+# Override the default cleanup function.
_cleanup()
{
_dmerror_cleanup
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/filter.btrfs
. ./common/dmerror
@@ -35,8 +27,6 @@ _require_scratch_dev_pool 3
_require_btrfs_dev_del_by_devid
_require_dm_target error
-rm -f $seqres.full
-
dev1="`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}'`"
dev2="`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $3}'`"
diff --git a/tests/btrfs/102 b/tests/btrfs/102
index 2642eb9b..e5a1b068 100755
--- a/tests/btrfs/102
+++ b/tests/btrfs/102
@@ -7,28 +7,16 @@
# Regression test for an ENOSPC issue when attempting to write to a file in
# a filesystem without any data block groups allocated.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
+. ./common/preamble
+_begin_fstest auto quick metadata enospc balance
+
+# Import common functions.
. ./common/filter
# real QA test starts here
_supported_fs btrfs
_require_scratch
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
# Mount our filesystem without space caches enabled so that we do not get any
diff --git a/tests/btrfs/103 b/tests/btrfs/103
index f554a484..57309106 100755
--- a/tests/btrfs/103
+++ b/tests/btrfs/103
@@ -7,20 +7,10 @@
# Regression test for file read corruption when using compressed extents that
# are shared by multiple consecutive ranges of the same file.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- rm -f $tmp.*
-}
+. ./common/preamble
+_begin_fstest auto quick clone compress
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -28,8 +18,6 @@ _supported_fs btrfs
_require_scratch
_require_cloner
-rm -f $seqres.full
-
test_clone_and_read_compressed_extent()
{
local mount_opts=$1
@@ -47,7 +35,6 @@ test_clone_and_read_compressed_extent()
-c "pwrite -S 0xcc $((3 * $BLOCK_SIZE)) $((1 * $BLOCK_SIZE))" \
$SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
-
# Now clone our extent into an adjacent offset.
$CLONER_PROG -s $((1 * $BLOCK_SIZE)) -d $((4 * $BLOCK_SIZE)) \
-l $((2 * $BLOCK_SIZE)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo
diff --git a/tests/btrfs/104 b/tests/btrfs/104
index b7269111..499de6bf 100755
--- a/tests/btrfs/104
+++ b/tests/btrfs/104
@@ -16,35 +16,17 @@
# Btrfs: keep dropped roots in cache until transaciton commit
# btrfs: qgroup: account shared subtree during snapshot delete
#
-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.*
-}
+. ./common/preamble
+_begin_fstest auto qgroup
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_scratch
_require_btrfs_qgroup_report
-rm -f $seqres.full
-
# Create an fs tree of a given height at a target location. This is
# done by agressively creating inline extents to expand the number of
# nodes required. We also add an traditional extent so that
diff --git a/tests/btrfs/105 b/tests/btrfs/105
index 96f11e4c..b6cc23b9 100755
--- a/tests/btrfs/105
+++ b/tests/btrfs/105
@@ -9,14 +9,10 @@
# gets replaced in the send snapshot by another one at the same exact location,
# with the same name and with the same inode number.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -24,8 +20,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -34,7 +29,6 @@ _require_scratch
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/106 b/tests/btrfs/106
index b181c3f4..db295e70 100755
--- a/tests/btrfs/106
+++ b/tests/btrfs/106
@@ -8,21 +8,10 @@
# that represent file ranges with a length that is a multiple of 16 pages
# and that are shared by multiple consecutive ranges of the same file.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick clone compress
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -30,8 +19,6 @@ _supported_fs btrfs
_require_scratch
_require_cloner
-rm -f $seqres.full
-
test_clone_and_read_compressed_extent()
{
local mount_opts=$1
diff --git a/tests/btrfs/107 b/tests/btrfs/107
index 80db5ab9..58ff6936 100755
--- a/tests/btrfs/107
+++ b/tests/btrfs/107
@@ -7,29 +7,13 @@
# Test that calling fallocate against a range which is already
# allocated does not truncate beyond EOF
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick prealloc
-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
. ./common/defrag
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
diff --git a/tests/btrfs/108 b/tests/btrfs/108
index bf13328b..0f734e9c 100755
--- a/tests/btrfs/108
+++ b/tests/btrfs/108
@@ -7,14 +7,10 @@
# Test that a send operation works correctly with reflinked files (cloned
# extents which multiple files point to).
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send clone punch
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -22,8 +18,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/reflink
@@ -35,7 +30,6 @@ _require_xfs_io_command "fpunch"
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/109 b/tests/btrfs/109
index b2edeb96..c545733e 100755
--- a/tests/btrfs/109
+++ b/tests/btrfs/109
@@ -7,14 +7,10 @@
# Test that a send operation works correctly with reflinked files (cloned
# extents which multiple files point to) that have compressed extents.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send clone compress
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -22,8 +18,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/reflink
@@ -34,7 +29,6 @@ _require_cp_reflink
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/110 b/tests/btrfs/110
index 3e914736..86049233 100755
--- a/tests/btrfs/110
+++ b/tests/btrfs/110
@@ -7,14 +7,10 @@
# Test that sending and receiving snapshots across different filesystems works
# for full and incremental send operations.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -22,8 +18,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -32,7 +27,6 @@ _require_scratch
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/111 b/tests/btrfs/111
index 376bea10..f03555bb 100755
--- a/tests/btrfs/111
+++ b/tests/btrfs/111
@@ -7,14 +7,10 @@
# Test that resending snapshots from a different filesystem is possible for
# both full and incremental send operations.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -22,8 +18,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -32,7 +27,6 @@ _require_scratch
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/112 b/tests/btrfs/112
index 97361e93..dac6b5b0 100755
--- a/tests/btrfs/112
+++ b/tests/btrfs/112
@@ -7,21 +7,10 @@
# Test several cases of cloning inline extents that used to lead to file
# corruption or data loss.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
+. ./common/preamble
+_begin_fstest auto quick clone
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/filter.btrfs
@@ -33,8 +22,6 @@ _require_btrfs_fs_feature "no_holes"
_require_btrfs_mkfs_feature "no-holes"
_require_xfs_io_command "falloc"
-rm -f $seqres.full
-
test_cloning_inline_extents()
{
local mkfs_opts=$1
diff --git a/tests/btrfs/113 b/tests/btrfs/113
index cab47784..7c90c3b6 100755
--- a/tests/btrfs/113
+++ b/tests/btrfs/113
@@ -9,21 +9,10 @@
# does not result in leaking stale data (data past the truncation offset) nor
# losing data in the clone operation's destination file.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick compress clone
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/filter.btrfs
@@ -32,8 +21,6 @@ _supported_fs btrfs
_require_scratch
_require_cloner
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount "-o compress"
diff --git a/tests/btrfs/114 b/tests/btrfs/114
index 2d9546a1..28e1ce34 100755
--- a/tests/btrfs/114
+++ b/tests/btrfs/114
@@ -7,28 +7,12 @@
# btrfs quota scan/unmount sanity test
# Make sure that unmounting during a quota rescan doesn't crash
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto 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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_scratch
diff --git a/tests/btrfs/115 b/tests/btrfs/115
index 02ae4e1d..715f10b2 100755
--- a/tests/btrfs/115
+++ b/tests/btrfs/115
@@ -7,28 +7,12 @@
# btrfs quota scan/disable sanity test
# Make sure that disabling quotas during a quota rescan doesn't crash
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto 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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_scratch
@@ -43,7 +27,6 @@ echo 3 > /proc/sys/vm/drop_caches
$BTRFS_UTIL_PROG quota enable $SCRATCH_MNT
$BTRFS_UTIL_PROG quota disable $SCRATCH_MNT
-
echo "Silence is golden"
status=0
exit
diff --git a/tests/btrfs/116 b/tests/btrfs/116
index 3ed097ec..14182e9c 100755
--- a/tests/btrfs/116
+++ b/tests/btrfs/116
@@ -9,29 +9,16 @@
# with the content they had before the fitrim operation. These regions of the
# device are reserved for a boot loader to use at its will.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick metadata
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
-
-# 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 >>$seqres.full 2>&1
# Write to the [0, 64Kb[ and [68Kb, 1Mb[ ranges of the device. These ranges are
diff --git a/tests/btrfs/117 b/tests/btrfs/117
index 0d3ab3cd..6539827b 100755
--- a/tests/btrfs/117
+++ b/tests/btrfs/117
@@ -8,22 +8,12 @@
# for files that have a full path containing more than one parent directory
# component.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick send clone
tmp=`mktemp -d`
-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
. ./common/reflink
@@ -32,8 +22,6 @@ _supported_fs btrfs
_require_scratch
_require_cp_reflink
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
diff --git a/tests/btrfs/118 b/tests/btrfs/118
index 89fe4d11..bd47748d 100755
--- a/tests/btrfs/118
+++ b/tests/btrfs/118
@@ -8,13 +8,10 @@
# deleted and crash, the next time we mount the filesystem, the log replay
# procedure will not fail and the snapshot is not present anymore.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick snapshot metadata log
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
@@ -22,8 +19,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmflakey
@@ -32,8 +28,6 @@ _supported_fs btrfs
_require_scratch
_require_dm_target flakey
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_require_metadata_journaling $SCRATCH_DEV
_init_flakey
diff --git a/tests/btrfs/119 b/tests/btrfs/119
index fd4d744b..d1926da9 100755
--- a/tests/btrfs/119
+++ b/tests/btrfs/119
@@ -7,13 +7,10 @@
# Test log tree replay when qgroups are enabled and orphan roots (deleted
# snapshots) exist.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick snapshot metadata qgroup log
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
@@ -21,8 +18,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmflakey
@@ -31,8 +27,6 @@ _supported_fs btrfs
_require_scratch
_require_dm_target flakey
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_require_metadata_journaling $SCRATCH_DEV
_init_flakey
diff --git a/tests/btrfs/120 b/tests/btrfs/120
index d52b1df9..ba297bbb 100755
--- a/tests/btrfs/120
+++ b/tests/btrfs/120
@@ -9,13 +9,10 @@
# the new directory or a file inside the new directory, the fsync succeeds,
# the fsync log is replayable and produces a correct result.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick snapshot metadata log
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
@@ -23,8 +20,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmflakey
@@ -33,8 +29,6 @@ _supported_fs btrfs
_require_scratch
_require_dm_target flakey
-rm -f $seqres.full
-
populate_testdir()
{
_run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT \
diff --git a/tests/btrfs/121 b/tests/btrfs/121
index 92026929..f4d54962 100755
--- a/tests/btrfs/121
+++ b/tests/btrfs/121
@@ -11,34 +11,16 @@
# [PATCH] btrfs: handle non-fatal errors in btrfs_qgroup_inherit()
# http://thread.gmane.org/gmane.comp.file-systems.btrfs/54755
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick snapshot 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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_scratch
-rm -f $seqres.full
-
_scratch_mkfs >/dev/null
_scratch_mount
_run_btrfs_util_prog quota enable $SCRATCH_MNT
diff --git a/tests/btrfs/122 b/tests/btrfs/122
index 70d1ec4f..34531753 100755
--- a/tests/btrfs/122
+++ b/tests/btrfs/122
@@ -7,35 +7,17 @@
# Test that qgroup counts are valid after snapshot creation. This has
# been broken in btrfs since Linux v4.1
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick snapshot 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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_scratch
_require_btrfs_qgroup_report
-rm -f $seqres.full
-
# Force a small leaf size to make it easier to blow out our root
# subvolume tree
_scratch_mkfs "--nodesize 16384" >/dev/null
@@ -62,7 +44,6 @@ _run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT "$SCRATCH_MNT/snaps/snap2"
_scratch_unmount
-
# qgroup will be checked by fstest at _check_scratch_fs()
status=0
exit
diff --git a/tests/btrfs/123 b/tests/btrfs/123
index c37fa720..c179eeec 100755
--- a/tests/btrfs/123
+++ b/tests/btrfs/123
@@ -10,28 +10,12 @@
# non-standard extent reference update, qgroup can't handle it correctly,
# and leads to corrupted qgroup numbers.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick qgroup balance
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/124 b/tests/btrfs/124
index 4588264c..3036cbf4 100755
--- a/tests/btrfs/124
+++ b/tests/btrfs/124
@@ -22,15 +22,10 @@
#
# Verify if all three checkpoints match
#
-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 replace volume balance
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -38,14 +33,10 @@ _cleanup()
_btrfs_rescan_devices
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/module
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
diff --git a/tests/btrfs/125 b/tests/btrfs/125
index d125b111..e46b194d 100755
--- a/tests/btrfs/125
+++ b/tests/btrfs/125
@@ -21,15 +21,10 @@
#
# Verify if all three checkpoints match
#
-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 replace volume balance
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -37,14 +32,10 @@ _cleanup()
_btrfs_rescan_devices
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/module
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
@@ -92,7 +83,6 @@ _run_btrfs_util_prog filesystem show
_run_btrfs_util_prog filesystem df $SCRATCH_MNT
count=$(( count-- ))
-
#-------------degraded-init-------------------
echo >> $seqres.full
echo "-----Write degraded mount fill upto $max_fs_sz bytes-----" >> $seqres.full
diff --git a/tests/btrfs/126 b/tests/btrfs/126
index 08d6ed4e..a13a0a6e 100755
--- a/tests/btrfs/126
+++ b/tests/btrfs/126
@@ -6,27 +6,11 @@
#
# Regression test for leaking data space after hitting EDQUOTA
#
-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/preamble
+_begin_fstest auto quick qgroup limit
-# remove previous $seqres.full before test
-rm -f $seqres.full
+# Import common functions.
+. ./common/filter
# real QA test starts here
diff --git a/tests/btrfs/127 b/tests/btrfs/127
index c9068c04..f2153172 100755
--- a/tests/btrfs/127
+++ b/tests/btrfs/127
@@ -8,14 +8,10 @@
# in the directory hierarchy that involve switching the inode that directory
# entries point to.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -23,8 +19,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -35,7 +30,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/128 b/tests/btrfs/128
index d7f8fb2d..baf194cf 100755
--- a/tests/btrfs/128
+++ b/tests/btrfs/128
@@ -7,14 +7,10 @@
# Test that, under a particular scenario, an incremental send operation does
# not leak memory (which used to emit a warning in dmesg/syslog).
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -22,8 +18,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -34,7 +29,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/129 b/tests/btrfs/129
index d504c81a..4e3046f3 100755
--- a/tests/btrfs/129
+++ b/tests/btrfs/129
@@ -8,14 +8,10 @@
# operations under a particular scenario (the rmdir operation is sent before
# the target directory is empty).
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -23,8 +19,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -35,7 +30,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/130 b/tests/btrfs/130
index ba5cbc35..6d9ddd48 100755
--- a/tests/btrfs/130
+++ b/tests/btrfs/130
@@ -11,29 +11,13 @@
# And unfortunately, btrfs send is one of these operations, and will cause
# softlock or OOM on systems with small memory(<4G).
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick clone send
-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
. ./common/reflink
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/131 b/tests/btrfs/131
index 395b6cc5..81e5d9bc 100755
--- a/tests/btrfs/131
+++ b/tests/btrfs/131
@@ -6,28 +6,12 @@
#
# Test free space tree mount options.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
diff --git a/tests/btrfs/132 b/tests/btrfs/132
index bd608bf6..f50420f5 100755
--- a/tests/btrfs/132
+++ b/tests/btrfs/132
@@ -9,15 +9,10 @@
# write whose max extent size is not 128M (including compression and in-band
# dedupe).
#
-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 enospc
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -26,13 +21,9 @@ _cleanup()
wait
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/133 b/tests/btrfs/133
index 5968ef13..4f45d6e8 100755
--- a/tests/btrfs/133
+++ b/tests/btrfs/133
@@ -8,14 +8,10 @@
# replaces an old inode that has the same number but different generation,
# and both are direct children of the subvolume/snapshot root.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -23,8 +19,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -35,7 +30,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/134 b/tests/btrfs/134
index d12dc73e..b16fbc74 100755
--- a/tests/btrfs/134
+++ b/tests/btrfs/134
@@ -8,14 +8,10 @@
# a new parent directory, deleting its previous parent directory and creating
# a new inode that has the same inode number as the old parent.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -23,8 +19,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -35,7 +30,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/135 b/tests/btrfs/135
index 6f57e4cf..36270562 100755
--- a/tests/btrfs/135
+++ b/tests/btrfs/135
@@ -9,14 +9,10 @@
# have an entry with the same name that corresponds to different inodes in each
# snapshot.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -24,8 +20,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -36,7 +31,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/136 b/tests/btrfs/136
index 1ca793aa..896be18d 100755
--- a/tests/btrfs/136
+++ b/tests/btrfs/136
@@ -11,28 +11,12 @@
# 3) populate data.
# 4) source has combination of non-extent and extent files.
# 5) convert it to btrfs, mount and verify contents.
-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.*
-}
+. ./common/preamble
+_begin_fstest auto convert
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
@@ -44,8 +28,6 @@ _require_command "$MKFS_EXT4_PROG" mkfs.ext4
_require_command "$E2FSCK_PROG" e2fsck
_require_command "$TUNE2FS_PROG" tune2fs
-rm -f $seqres.full
-
BLOCK_SIZE=`_get_block_size $TEST_DIR`
EXT_MD5SUM="$tmp.ext43"
BTRFS_MD5SUM="$tmp.btrfs"
diff --git a/tests/btrfs/137 b/tests/btrfs/137
index 05f665f0..64ed2450 100755
--- a/tests/btrfs/137
+++ b/tests/btrfs/137
@@ -6,14 +6,10 @@
#
# Test that both incremental and full send operations preserve file holes.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -21,8 +17,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/punch
@@ -34,7 +29,6 @@ _require_xfs_io_command "fiemap"
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/138 b/tests/btrfs/138
index eac66caf..f99e58e7 100755
--- a/tests/btrfs/138
+++ b/tests/btrfs/138
@@ -7,28 +7,12 @@
# Test decompression in the middle of large extents. Regression test for Linux
# kernel commit 6e78b3f7a193 ("Btrfs: fix btrfs_decompress_buf2page()").
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto compress
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
diff --git a/tests/btrfs/139 b/tests/btrfs/139
index 047a41ca..7760182a 100755
--- a/tests/btrfs/139
+++ b/tests/btrfs/139
@@ -9,28 +9,12 @@
#
# Finally we create files to exceed the quota.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto qgroup limit
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
_supported_fs btrfs
# We at least need 2GB of free space on $SCRATCH_DEV
_require_scratch_size $((2 * 1024 * 1024))
@@ -45,7 +29,6 @@ _run_btrfs_util_prog quota enable $SCRATCH_MNT
_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
_run_btrfs_util_prog qgroup limit -e 1G $SUBVOL
-
# Write and delete files within 1G limits, multiple times
for i in $(seq 1 5); do
for j in $(seq 1 240); do
diff --git a/tests/btrfs/140 b/tests/btrfs/140
index 86fb0d58..f3379cae 100755
--- a/tests/btrfs/140
+++ b/tests/btrfs/140
@@ -11,28 +11,12 @@
# The upstream fix is
# commit 2e949b0a5592 ("Btrfs: fix invalid dereference in btrfs_retry_endio")
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/141 b/tests/btrfs/141
index bc4ba52d..6f9a177a 100755
--- a/tests/btrfs/141
+++ b/tests/btrfs/141
@@ -12,28 +12,12 @@
# The upstream fix is
# Commit 9d0d1c8b1c9d ("Btrfs: bring back repair during read")
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/142 b/tests/btrfs/142
index c8660fd6..3caa37d1 100755
--- a/tests/btrfs/142
+++ b/tests/btrfs/142
@@ -12,29 +12,13 @@
# The upstream fix is
# commit 97bf5a5589aa ("Btrfs: fix segmentation fault when doing dio read")
#
-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/preamble
+_begin_fstest auto quick
+
+# Import common functions.
. ./common/filter
. ./common/dmdust
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/143 b/tests/btrfs/143
index 88fdbe60..f062f77b 100755
--- a/tests/btrfs/143
+++ b/tests/btrfs/143
@@ -19,29 +19,13 @@
# The upstream fix is
# commit 9d0d1c8b1c9d ("Btrfs: bring back repair during read")
#
-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/preamble
+_begin_fstest auto quick
+
+# Import common functions.
. ./common/filter
. ./common/dmdust
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/144 b/tests/btrfs/144
index c77e4cf1..d41ce7e3 100755
--- a/tests/btrfs/144
+++ b/tests/btrfs/144
@@ -8,14 +8,10 @@
# renamed, a new hard link added to it and some other inode B is renamed to
# the old name of inode A.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -23,8 +19,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -35,7 +30,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/145 b/tests/btrfs/145
index 825b7bd5..ba97a2ad 100755
--- a/tests/btrfs/145
+++ b/tests/btrfs/145
@@ -8,14 +8,10 @@
# then rename some file inode B to the name inode A had, for the case where the
# directory inode A is an ancestor of inode B in the parent snapshot.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -23,8 +19,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -35,7 +30,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/146 b/tests/btrfs/146
index c5feae83..64c3513f 100755
--- a/tests/btrfs/146
+++ b/tests/btrfs/146
@@ -9,15 +9,10 @@
# on all fds and fsync on all fds. Ensure that we get errors on all of them.
# Then fsync on all one last time and verify that all return 0.
#
-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 quick eio
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -25,8 +20,7 @@ _cleanup()
_dmerror_cleanup
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmerror
@@ -47,8 +41,6 @@ SCRATCH_DEV=$DMERROR_DEV
_require_scratch
_require_scratch_dev_pool
-rm -f $seqres.full
-
echo "Format and mount"
# Build a filesystem with 2 devices that stripes the data across
diff --git a/tests/btrfs/147 b/tests/btrfs/147
index d58b53aa..74ead3d6 100755
--- a/tests/btrfs/147
+++ b/tests/btrfs/147
@@ -8,14 +8,10 @@
# some directory inode A, renaming a regular file inode B into the old name of
# inode A and finally creating a new hard link for inode B at directory inode A.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -23,8 +19,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -35,7 +30,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/148 b/tests/btrfs/148
index 4bb99714..510e46dc 100755
--- a/tests/btrfs/148
+++ b/tests/btrfs/148
@@ -6,22 +6,10 @@
#
# Test that direct IO writes work on RAID5 and RAID6 filesystems.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick rw
-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
@@ -33,8 +21,6 @@ _require_btrfs_fs_feature raid56
_scratch_dev_pool_get 4
-rm -f $seqres.full
-
test_direct_io_write()
{
local mkfs_options=$1
diff --git a/tests/btrfs/149 b/tests/btrfs/149
index e42c760c..176d8ec5 100755
--- a/tests/btrfs/149
+++ b/tests/btrfs/149
@@ -9,14 +9,10 @@
# has an extent at a file offset 0 that is not compressed and that is
# shared.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send compress
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -24,8 +20,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/reflink
@@ -39,7 +34,6 @@ _require_btrfs_command inspect-internal dump-super
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/150 b/tests/btrfs/150
index 0840e0a0..56938b0f 100755
--- a/tests/btrfs/150
+++ b/tests/btrfs/150
@@ -10,28 +10,12 @@
# The patch to fix it is
# Btrfs: fix kernel oops while reading compressed data
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick dangerous
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/151 b/tests/btrfs/151
index cd18f895..3150fef0 100755
--- a/tests/btrfs/151
+++ b/tests/btrfs/151
@@ -10,28 +10,12 @@
# The fix is
# Btrfs: avoid losing data raid profile when deleting a device
#
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/152 b/tests/btrfs/152
index 9cbd24cf..75f576c3 100755
--- a/tests/btrfs/152
+++ b/tests/btrfs/152
@@ -7,30 +7,16 @@
# Test that incremental send/receive operations don't corrupt metadata when
# qgroups are enabled.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick metadata qgroup send
-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
_supported_fs btrfs
_require_scratch
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
diff --git a/tests/btrfs/153 b/tests/btrfs/153
index e802acc0..4c28a2b8 100755
--- a/tests/btrfs/153
+++ b/tests/btrfs/153
@@ -6,28 +6,12 @@
#
# Test for leaking quota reservations on preallocated files.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick qgroup limit
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/154 b/tests/btrfs/154
index f5dfce4b..240c504c 100755
--- a/tests/btrfs/154
+++ b/tests/btrfs/154
@@ -11,23 +11,10 @@
# This bug is going to be fixed by a patch for kernel titled
# "btrfs: correctly calculate item size used when item key collision happens"
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick
-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
@@ -36,8 +23,6 @@ _supported_fs btrfs
_require_scratch
_require_command $PYTHON2_PROG python2
-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
diff --git a/tests/btrfs/155 b/tests/btrfs/155
index fcb73382..e99a1054 100755
--- a/tests/btrfs/155
+++ b/tests/btrfs/155
@@ -8,14 +8,10 @@
# hard links has some of its hard links renamed in the send snapshot, with one
# of them getting the same path that some other inode had in the send snapshot.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -23,8 +19,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -35,7 +30,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/156 b/tests/btrfs/156
index 89c80e71..364135ab 100755
--- a/tests/btrfs/156
+++ b/tests/btrfs/156
@@ -14,27 +14,11 @@
#
# Fixed by patch named "btrfs: Ensure btrfs_trim_fs can trim the whole fs".
#
-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/preamble
+_begin_fstest auto quick trim balance
-# remove previous $seqres.full before test
-rm -f $seqres.full
+# Import common functions.
+. ./common/filter
# real QA test starts here
diff --git a/tests/btrfs/157 b/tests/btrfs/157
index e7118dbc..c08cebdc 100755
--- a/tests/btrfs/157
+++ b/tests/btrfs/157
@@ -20,28 +20,12 @@
# Btrfs: do not merge rbios if their fail stripe index are not identical
# Btrfs: make raid6 rebuild retry more
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick raid
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/158 b/tests/btrfs/158
index 803d6b9e..4a642f52 100755
--- a/tests/btrfs/158
+++ b/tests/btrfs/158
@@ -12,28 +12,12 @@
# Btrfs: make raid6 rebuild retry more
# Btrfs: fix scrub to repair raid6 corruption
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick raid scrub
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/159 b/tests/btrfs/159
index cf4f1f47..7641f65d 100755
--- a/tests/btrfs/159
+++ b/tests/btrfs/159
@@ -8,13 +8,10 @@
# layout, if we punch a hole and fsync the file, at replay time the whole
# hole was preserved.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick punch log
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
@@ -22,8 +19,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmflakey
@@ -34,8 +30,6 @@ _require_dm_target flakey
_require_xfs_io_command "fpunch"
_require_odirect
-rm -f $seqres.full
-
run_test()
{
local punch_offset=$1
diff --git a/tests/btrfs/160 b/tests/btrfs/160
index ed3d9483..48c2133c 100755
--- a/tests/btrfs/160
+++ b/tests/btrfs/160
@@ -8,15 +8,10 @@
# errors, write to it again and call sync. Close the file, reopen it and
# then call fsync on it. Is the error reported?
#
-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 quick eio
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -24,8 +19,7 @@ _cleanup()
_dmerror_cleanup
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmerror
@@ -35,8 +29,6 @@ _require_scratch_dev_pool
_require_dm_target error
-rm -f $seqres.full
-
# bring up dmerror device
_dmerror_init
diff --git a/tests/btrfs/161 b/tests/btrfs/161
index 078e570e..059b95ca 100755
--- a/tests/btrfs/161
+++ b/tests/btrfs/161
@@ -8,28 +8,12 @@
# Create a seed device, mount it and, add a new device to create a
# sprout filesystem.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick volume seed
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/162 b/tests/btrfs/162
index 83816ad0..ba37ef0c 100755
--- a/tests/btrfs/162
+++ b/tests/btrfs/162
@@ -9,29 +9,13 @@
# Create a sprout device
# Make the sprout device a seed device and create a sprout device again
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick volume seed
-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
. ./common/filter.btrfs
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/163 b/tests/btrfs/163
index b6bd6906..1dc081f1 100755
--- a/tests/btrfs/163
+++ b/tests/btrfs/163
@@ -13,15 +13,10 @@
# Depends on the kernel patch
# c6a5d954950c btrfs: fail replace of seed device
-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 quick volume seed
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -29,14 +24,10 @@ _cleanup()
_btrfs_rescan_devices
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/filter.btrfs
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/164 b/tests/btrfs/164
index ad22b6a4..59a9c90e 100755
--- a/tests/btrfs/164
+++ b/tests/btrfs/164
@@ -9,15 +9,10 @@
# Create a sprout device
# Remount RW
# Run device delete on the seed device
-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 quick volume
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -25,13 +20,9 @@ _cleanup()
_btrfs_rescan_devices
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/module
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/165 b/tests/btrfs/165
index 762409cf..c4a52a15 100755
--- a/tests/btrfs/165
+++ b/tests/btrfs/165
@@ -9,20 +9,8 @@
# This behavior has been restricted long time but becomes allowed by kernel
# commit a79a464d5675 ("btrfs: Allow rmdir(2) to delete an empty subvolume")
#
-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.*
-}
+. ./common/preamble
+_begin_fstest auto quick subvol
create_subvol()
{
@@ -43,13 +31,9 @@ rm_r_subvol() {
rm -r $1 >> $seqres.full 2>&1
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_scratch
diff --git a/tests/btrfs/166 b/tests/btrfs/166
index a15f0cd8..47f7f9b3 100755
--- a/tests/btrfs/166
+++ b/tests/btrfs/166
@@ -8,13 +8,10 @@
# enabled while the quota rescan kernel thread is running, we will be able
# to mount the filesystem after the power failure.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick qgroup
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
@@ -22,8 +19,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmflakey
@@ -32,8 +28,6 @@ _supported_fs btrfs
_require_scratch
_require_dm_target flakey
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_require_metadata_journaling $SCRATCH_DEV
_init_flakey
diff --git a/tests/btrfs/167 b/tests/btrfs/167
index 0b5e8937..fb271cfa 100755
--- a/tests/btrfs/167
+++ b/tests/btrfs/167
@@ -10,28 +10,12 @@
# This could be fixed by the following kernel commit:
# ac0b4145d662 ("btrfs: scrub: Don't use inode pages for device replace")
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick replace 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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/168 b/tests/btrfs/168
index 1e461c0f..acc58b51 100755
--- a/tests/btrfs/168
+++ b/tests/btrfs/168
@@ -8,13 +8,10 @@
# (or subvolume) has a file that is deleted while there is still a open file
# descriptor for that file.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -22,8 +19,7 @@ _cleanup()
rm -fr $send_files_dir
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -35,7 +31,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/169 b/tests/btrfs/169
index 1a9bbe33..a3f823fe 100755
--- a/tests/btrfs/169
+++ b/tests/btrfs/169
@@ -8,13 +8,10 @@
# that has a prealloc (unwritten) extent beyond its EOF gets a hole punched
# in a section of that prealloc extent.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -22,8 +19,7 @@ _cleanup()
rm -fr $send_files_dir
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -35,7 +31,6 @@ _require_xfs_io_command "falloc" "-k"
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/170 b/tests/btrfs/170
index 7ad28b3f..15382eb3 100755
--- a/tests/btrfs/170
+++ b/tests/btrfs/170
@@ -8,21 +8,10 @@
# more space left to allocate in the filesystem and then snapshot the file's
# subvolume, after a clean shutdown the data was not lost.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick snapshot
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -30,8 +19,6 @@ _supported_fs btrfs
_require_scratch
_require_xfs_io_command "falloc" "-k"
-rm -f $seqres.full
-
# Use a fixed size filesystem so that we can precisely fill the data block group
# mkfs.btrfs creates and allocate all unused space for a new data block group.
# It's important to not use the mixed block groups feature as well because we
diff --git a/tests/btrfs/171 b/tests/btrfs/171
index 4199d1d2..461cdd0f 100755
--- a/tests/btrfs/171
+++ b/tests/btrfs/171
@@ -10,29 +10,13 @@
# Fixed by the following kernel patch:
# "btrfs: qgroup: Dirty all qgroups before rescan"
#
-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
. ./common/filter.btrfs
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_scratch
@@ -40,7 +24,6 @@ _require_scratch
_scratch_mkfs > /dev/null 2>&1
_scratch_mount
-
# Populate the fs
$BTRFS_UTIL_PROG subvolume create "$SCRATCH_MNT/subvol" > /dev/null
_pwrite_byte 0xcdcd 0 1M "$SCRATCH_MNT/subvol/file1" > /dev/null
@@ -51,7 +34,6 @@ sync
$BTRFS_UTIL_PROG subvolume snapshot "$SCRATCH_MNT/subvol" \
"$SCRATCH_MNT/snapshot" > /dev/null
-
$BTRFS_UTIL_PROG quota enable "$SCRATCH_MNT" > /dev/null
$BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" > /dev/null
diff --git a/tests/btrfs/172 b/tests/btrfs/172
index 9cda7d60..4db54642 100755
--- a/tests/btrfs/172
+++ b/tests/btrfs/172
@@ -10,29 +10,13 @@
# btrfs: use the file extent tree infrastructure
# btrfs: replace all uses of btrfs_ordered_update_i_size
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick log replay
-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
. ./common/dmlogwrites
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/173 b/tests/btrfs/173
index ecea1106..1252587c 100755
--- a/tests/btrfs/173
+++ b/tests/btrfs/173
@@ -7,26 +7,11 @@
# Test swap file activation restrictions specific to Btrfs, swap file can't be
# CoW file nor compressed file.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick swap
-here=`pwd`
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
-
-. ./common/rc
. ./common/filter
-rm -f $seqres.full
-
_supported_fs btrfs
_require_scratch_swapfile
diff --git a/tests/btrfs/174 b/tests/btrfs/174
index ec2c04b0..8bf856ae 100755
--- a/tests/btrfs/174
+++ b/tests/btrfs/174
@@ -7,26 +7,11 @@
# Test restrictions on operations that can be done on an active swap file
# specific to Btrfs.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick swap
-here=`pwd`
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
-
-. ./common/rc
. ./common/filter
-rm -f $seqres.full
-
_supported_fs btrfs
_require_scratch_swapfile
diff --git a/tests/btrfs/175 b/tests/btrfs/175
index 94f56284..8a9c0721 100755
--- a/tests/btrfs/175
+++ b/tests/btrfs/175
@@ -6,26 +6,11 @@
#
# Test swap file activation on multiple devices.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick swap 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.*
-}
-
-. ./common/rc
. ./common/filter
-rm -f $seqres.full
-
_supported_fs btrfs
_require_scratch_dev_pool 2
_require_scratch_swapfile
diff --git a/tests/btrfs/176 b/tests/btrfs/176
index 838c25db..41b02eb6 100755
--- a/tests/btrfs/176
+++ b/tests/btrfs/176
@@ -6,28 +6,12 @@
#
# Test device remove/replace with an active swap file.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick swap 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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/177 b/tests/btrfs/177
index bfcd07bf..966d29d7 100755
--- a/tests/btrfs/177
+++ b/tests/btrfs/177
@@ -6,27 +6,12 @@
#
# Test relocation (balance and resize) with an active swap file.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick swap balance
-here=`pwd`
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
-
-. ./common/rc
. ./common/filter
. ./common/btrfs
-rm -f $seqres.full
-
# Modify as appropriate.
_supported_fs btrfs
_require_scratch_swapfile
diff --git a/tests/btrfs/178 b/tests/btrfs/178
index a80d1eca..5e148615 100755
--- a/tests/btrfs/178
+++ b/tests/btrfs/178
@@ -10,14 +10,10 @@
# become descendents of multiple directories that used to be their ancestors in
# the parent snapshot. This used to trigger an infinite loop in the kernel code.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -25,8 +21,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -37,7 +32,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/179 b/tests/btrfs/179
index 8a12b012..9a3b36ab 100755
--- a/tests/btrfs/179
+++ b/tests/btrfs/179
@@ -9,28 +9,12 @@
# This bug is going to be fixed by a patch for the kernel titled
# "btrfs: qgroup: Don't trigger backref walk at delayed ref insert time".
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto qgroup dangerous
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/180 b/tests/btrfs/180
index fe538fc5..68e382f6 100755
--- a/tests/btrfs/180
+++ b/tests/btrfs/180
@@ -10,27 +10,11 @@
# This bug is going to be fxied by a patch for kernel titled
# "btrfs: qgroup: Make qgroup async transaction commit more aggressive"
#
-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/preamble
+_begin_fstest auto quick qgroup limit
-# remove previous $seqres.full before test
-rm -f $seqres.full
+# Import common functions.
+. ./common/filter
# real QA test starts here
diff --git a/tests/btrfs/181 b/tests/btrfs/181
index d27850f8..843413fc 100755
--- a/tests/btrfs/181
+++ b/tests/btrfs/181
@@ -10,28 +10,12 @@
# This bug is going to be fixed by a patch for kernel title
# "btrfs: don't end the transaction for delayed refs in throttle"
#
-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!
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/182 b/tests/btrfs/182
index 34ee728f..1967469b 100755
--- a/tests/btrfs/182
+++ b/tests/btrfs/182
@@ -12,27 +12,11 @@
# There is one proposed patch for btrfs-progs to fix it, titled:
# "btrfs-progs: balance: Sync the fs before balancing metadata chunks"
#
-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/preamble
+_begin_fstest auto quick balance
-# remove previous $seqres.full before test
-rm -f $seqres.full
+# Import common functions.
+. ./common/filter
# real QA test starts here
diff --git a/tests/btrfs/183 b/tests/btrfs/183
index 63703c08..e7afb058 100755
--- a/tests/btrfs/183
+++ b/tests/btrfs/183
@@ -7,21 +7,10 @@
# Regression test for read corruption of compressed and shared extents after
# punching holes into a file.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick clone compress punch
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/reflink
@@ -30,8 +19,6 @@ _supported_fs btrfs
_require_scratch_reflink
_require_xfs_io_command "fpunch"
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount "-o compress"
diff --git a/tests/btrfs/184 b/tests/btrfs/184
index 53277c7e..2efcfb64 100755
--- a/tests/btrfs/184
+++ b/tests/btrfs/184
@@ -7,27 +7,12 @@
# Verify that when a device is removed from a multi-device
# filesystem its superblock copies are correctly deleted
#
-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
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_scratch
diff --git a/tests/btrfs/185 b/tests/btrfs/185
index 86af0563..7850f1bc 100755
--- a/tests/btrfs/185
+++ b/tests/btrfs/185
@@ -8,16 +8,11 @@
# Could be fixed by
# a9261d4125c9 ("btrfs: harden agaist duplicate fsid on scanned devices")
#
-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 volume
mnt=$TEST_DIR/$seq.mnt
+# Override the default cleanup function.
_cleanup()
{
rm -rf $mnt > /dev/null 2>&1
@@ -25,13 +20,9 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_scratch_dev_pool 2
diff --git a/tests/btrfs/186 b/tests/btrfs/186
index d8c970ea..b52d0b05 100755
--- a/tests/btrfs/186
+++ b/tests/btrfs/186
@@ -9,13 +9,10 @@
# readonly mode and then use it for send a operation, the send stream will
# contain the delalloc data - that is, no data loss happens.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send volume
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -23,8 +20,7 @@ _cleanup()
rm -fr $send_files_dir
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -35,7 +31,6 @@ _require_btrfs_command "property"
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/187 b/tests/btrfs/187
index 7da09abd..574636a6 100755
--- a/tests/btrfs/187
+++ b/tests/btrfs/187
@@ -12,21 +12,10 @@
# with large differences between the parent and send snapshots in order to hit
# such issues with a good probability.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
+. ./common/preamble
+_begin_fstest auto send dedupe clone balance
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/attr
. ./common/filter
. ./common/reflink
@@ -36,8 +25,6 @@ _supported_fs btrfs
_require_scratch_dedupe
_require_attrs
-rm -f $seqres.full
-
# We at least need 8GB of free space on $SCRATCH_DEV
_require_scratch_size $((8 * 1024 * 1024))
diff --git a/tests/btrfs/188 b/tests/btrfs/188
index bc655025..fcaf84b1 100755
--- a/tests/btrfs/188
+++ b/tests/btrfs/188
@@ -9,13 +9,10 @@
# start after its size and hole is punched (after the first snapshot is made)
# that removes all extents from some offset up to the file's size.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send prealloc punch
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -23,8 +20,7 @@ _cleanup()
rm -fr $send_files_dir
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -38,7 +34,6 @@ _require_xfs_io_command "falloc" "-k"
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/189 b/tests/btrfs/189
index 9dbd31a6..ec6e56fa 100755
--- a/tests/btrfs/189
+++ b/tests/btrfs/189
@@ -11,13 +11,10 @@
# commit ac765f83f1397646 ("Btrfs: fix data corruption due to cloning of eof
# block"), or cause silent data corruption for older kernels.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send clone
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -25,8 +22,7 @@ _cleanup()
rm -fr $send_files_dir
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/reflink
@@ -38,7 +34,6 @@ _require_scratch_reflink
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/190 b/tests/btrfs/190
index 820b0a96..3aa718e2 100755
--- a/tests/btrfs/190
+++ b/tests/btrfs/190
@@ -7,29 +7,13 @@
# A general test to validate that balance and qgroups work correctly when
# balance needs to be resumed on mount.
#
-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/preamble
+_begin_fstest auto quick replay balance qgroup
+
+# Import common functions.
. ./common/filter
. ./common/dmlogwrites
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/191 b/tests/btrfs/191
index 3fb35634..3c565d0a 100755
--- a/tests/btrfs/191
+++ b/tests/btrfs/191
@@ -7,14 +7,10 @@
# Test that an incremental send operation works after deduplicating into the
# same file in both the parent and send snapshots.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send dedupe
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -22,8 +18,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/reflink
@@ -35,7 +30,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/192 b/tests/btrfs/192
index 8d742119..dd197b6b 100755
--- a/tests/btrfs/192
+++ b/tests/btrfs/192
@@ -7,15 +7,10 @@
# Test btrfs consistency after each FUA for a workload with snapshot creation
# and removal
#
-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 replay snapshot stress
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -27,15 +22,11 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/attr
. ./common/dmlogwrites
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/193 b/tests/btrfs/193
index f4a1b5c9..ae293f2e 100755
--- a/tests/btrfs/193
+++ b/tests/btrfs/193
@@ -9,28 +9,12 @@
# The fix is titled:
# "btrfs: qgroup: Fix the wrong target io_tree when freeing reserved data space"
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick qgroup enospc limit
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/194 b/tests/btrfs/194
index 16334a35..9a67e572 100755
--- a/tests/btrfs/194
+++ b/tests/btrfs/194
@@ -10,28 +10,12 @@
# tree-checker: Verify dev item").
# The fix is titled: "btrfs: tree-checker: Fix wrong check on max devid"
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto 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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/195 b/tests/btrfs/195
index 8659e1db..59b97970 100755
--- a/tests/btrfs/195
+++ b/tests/btrfs/195
@@ -7,35 +7,18 @@
# Test raid profile conversion. It's sufficient to test all dest profiles as
# source profiles just rely on being able to read the data and metadata.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto volume balance
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
_supported_fs btrfs
_require_scratch_dev_pool 4
-
declare -a TEST_VECTORS=(
# $nr_dev_min:$data:$metadata:$data_convert:$metadata_convert
"4:single:raid1"
diff --git a/tests/btrfs/196 b/tests/btrfs/196
index 9c9eec9a..71b67ce2 100755
--- a/tests/btrfs/196
+++ b/tests/btrfs/196
@@ -11,16 +11,12 @@
#
# Will do log replay and check the filesystem.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto metadata log volume
-here=`pwd`
-tmp=/tmp/$$
fio_config=$tmp.fio
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -29,15 +25,11 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmthin
. ./common/dmlogwrites
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/197 b/tests/btrfs/197
index 6f199352..f5baf5b6 100755
--- a/tests/btrfs/197
+++ b/tests/btrfs/197
@@ -9,15 +9,10 @@
# btrfs: include non-missing as a qualifier for the latest_bdev
# btrfs: remove identified alien btrfs device in open_fs_devices
#
-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 quick volume
+# Override the default cleanup function.
_cleanup()
{
$UMOUNT_PROG $TEST_DIR/$seq.mnt >/dev/null 2>&1
@@ -26,14 +21,10 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/filter.btrfs
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_test
diff --git a/tests/btrfs/198 b/tests/btrfs/198
index 330fcee2..b3e175a2 100755
--- a/tests/btrfs/198
+++ b/tests/btrfs/198
@@ -8,29 +8,13 @@
# Bug fixed in:
# btrfs: remove identified alien device in open_fs_devices
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest 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
. ./common/filter.btrfs
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_command "$WIPEFS_PROG" wipefs
diff --git a/tests/btrfs/199 b/tests/btrfs/199
index 5a0b4382..6aca62f4 100755
--- a/tests/btrfs/199
+++ b/tests/btrfs/199
@@ -15,15 +15,10 @@
# The fix is: "btrfs: extent-tree: Ensure we trim ranges across block group
# boundary"
#
-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 quick trim
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -32,13 +27,9 @@ _cleanup()
rm -rf $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
@@ -115,7 +106,6 @@ sync
_pwrite_byte 0xcd 0 1M $loop_mnt/tail_padding > /dev/null
sync
-
$XFS_IO_PROG -c "fiemap" $loop_mnt/cross_boundary >> $seqres.full
# Ensure all extent are continuous
# Btrfs fiemap will merge continuous results, so the output should be only
diff --git a/tests/btrfs/200 b/tests/btrfs/200
index fd0d18d3..48cd7046 100755
--- a/tests/btrfs/200
+++ b/tests/btrfs/200
@@ -7,13 +7,10 @@
# Check that send operations (full and incremental) are able to issue clone
# operations for extents that are shared between the same file.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send clone
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -21,8 +18,7 @@ _cleanup()
rm -fr $send_files_dir
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/reflink
. ./common/punch
@@ -36,7 +32,6 @@ _require_xfs_io_command "fiemap"
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/201 b/tests/btrfs/201
index 26d502cf..e61abb5e 100755
--- a/tests/btrfs/201
+++ b/tests/btrfs/201
@@ -8,13 +8,10 @@
# layout, if we punch a hole that starts at file offset 0 and fsync the file,
# after replaying the log the hole exists.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick punch log
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
@@ -22,8 +19,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/attr
. ./common/filter
. ./common/dmflakey
@@ -38,8 +34,6 @@ _require_btrfs_fs_feature "no_holes"
_require_btrfs_mkfs_feature "no-holes"
_require_odirect
-rm -f $seqres.full
-
run_test_leading_hole()
{
# We create the filesystem with a node size of 64Kb because we need to
@@ -163,7 +157,6 @@ run_test_middle_hole()
_cleanup_flakey
}
-
echo "Testing with hole offset 0 hole length 65536"
run_test_leading_hole
diff --git a/tests/btrfs/202 b/tests/btrfs/202
index e9bae375..c1fa3c3f 100755
--- a/tests/btrfs/202
+++ b/tests/btrfs/202
@@ -5,25 +5,10 @@
#
# Regression test for fix "btrfs: fix invalid removal of root ref"
#
-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.*
-}
-
-. ./common/rc
-. ./common/filter
+. ./common/preamble
+_begin_fstest auto quick subvol snapshot
-rm -f $seqres.full
+. ./common/filter
_supported_fs btrfs
diff --git a/tests/btrfs/203 b/tests/btrfs/203
index 899772f7..e506118e 100755
--- a/tests/btrfs/203
+++ b/tests/btrfs/203
@@ -8,13 +8,10 @@
# extents with itself in the send snapshot, with a hole between them, and the
# file size has increased in the send snapshot.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send clone
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -22,8 +19,7 @@ _cleanup()
rm -fr $send_files_dir
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/reflink
@@ -34,7 +30,6 @@ _require_scratch_reflink
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/204 b/tests/btrfs/204
index add20e8b..ec751e42 100755
--- a/tests/btrfs/204
+++ b/tests/btrfs/204
@@ -7,28 +7,12 @@
# Test if the unaligned (by size and offset) punch hole is successful when FS
# is at ENOSPC.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick punch
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/205 b/tests/btrfs/205
index b53e0e52..dae8c68f 100755
--- a/tests/btrfs/205
+++ b/tests/btrfs/205
@@ -13,27 +13,13 @@
#
# "Btrfs: implement full reflink support for inline extents"
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
+. ./common/preamble
+_begin_fstest auto quick clone compress
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/reflink
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_scratch_reflink
diff --git a/tests/btrfs/206 b/tests/btrfs/206
index d64718f4..c45b89e6 100755
--- a/tests/btrfs/206
+++ b/tests/btrfs/206
@@ -11,29 +11,13 @@
# btrfs: use the file extent tree infrastructure
# btrfs: replace all uses of btrfs_ordered_update_i_size
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick log replay
-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
. ./common/dmlogwrites
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
_require_test
diff --git a/tests/btrfs/207 b/tests/btrfs/207
index c8f6908d..dc35899b 100755
--- a/tests/btrfs/207
+++ b/tests/btrfs/207
@@ -7,28 +7,12 @@
# Test large DIO reads and writes with various profiles. Regression test for
# patch "btrfs: fix RAID direct I/O reads with alternate csums".
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto rw raid
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
_supported_fs btrfs
# we check scratch dev after each loop
_require_scratch_nocheck
diff --git a/tests/btrfs/208 b/tests/btrfs/208
index 0ab15b6a..909f9fa4 100755
--- a/tests/btrfs/208
+++ b/tests/btrfs/208
@@ -7,14 +7,10 @@
# Test subvolume deletion using the subvolume id, even when the subvolume in
# question is in a different mount space.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
+. ./common/preamble
+_begin_fstest auto quick subvol
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/filter.btrfs
diff --git a/tests/btrfs/209 b/tests/btrfs/209
index df824d78..3094885f 100755
--- a/tests/btrfs/209
+++ b/tests/btrfs/209
@@ -9,13 +9,10 @@
# do not end up with a missing file extent representing a hole. This applies
# only when not using the NO_HOLES feature.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick log
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
@@ -23,8 +20,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/attr
. ./common/filter
. ./common/dmflakey
@@ -37,8 +33,6 @@ _require_btrfs_fs_feature "no_holes"
_require_btrfs_mkfs_feature "no-holes"
_require_xfs_io_command "sync_range"
-rm -f $seqres.full
-
_scratch_mkfs -O ^no-holes >>$seqres.full 2>&1
_require_metadata_journaling $SCRATCH_DEV
_init_flakey
diff --git a/tests/btrfs/210 b/tests/btrfs/210
index 2d8d811a..383a307f 100755
--- a/tests/btrfs/210
+++ b/tests/btrfs/210
@@ -7,27 +7,11 @@
# Test that a new snapshot created with qgroup inherit passed should mark
# qgroup numbers inconsistent.
#
-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/preamble
+_begin_fstest auto quick qgroup snapshot
-# remove previous $seqres.full before test
-rm -f $seqres.full
+# Import common functions.
+. ./common/filter
# real QA test starts here
diff --git a/tests/btrfs/211 b/tests/btrfs/211
index 3ae5e3fa..60ef3d1b 100755
--- a/tests/btrfs/211
+++ b/tests/btrfs/211
@@ -9,13 +9,10 @@
# and implicit file holes after a power failure. Test both without and with
# the NO_HOLES feature.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick log prealloc
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
@@ -23,8 +20,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmflakey
@@ -38,8 +34,6 @@ _require_btrfs_fs_feature "no_holes"
_require_btrfs_mkfs_feature "no-holes"
_require_dm_target flakey
-rm -f $seqres.full
-
run_test()
{
# Create our test file with 2 consecutive prealloc extents, each with a size
diff --git a/tests/btrfs/212 b/tests/btrfs/212
index 30bacd66..a7df938b 100755
--- a/tests/btrfs/212
+++ b/tests/btrfs/212
@@ -7,15 +7,10 @@
# Test if unmounting a fs with balance canceled can lead to crash.
# This needs CONFIG_BTRFS_DEBUG compiled, which adds extra unmount time self-test
#
-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 balance dangerous
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -27,13 +22,9 @@ _cleanup()
wait
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/213 b/tests/btrfs/213
index 58ca70c2..8a10355c 100755
--- a/tests/btrfs/213
+++ b/tests/btrfs/213
@@ -6,15 +6,10 @@
#
# Test if canceling a running balance can lead to dead looping balance
#
-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 balance dangerous
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -22,13 +17,9 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# Modify as appropriate.
_supported_fs btrfs
_require_scratch
diff --git a/tests/btrfs/214 b/tests/btrfs/214
index 123c4cbf..2a728f7e 100755
--- a/tests/btrfs/214
+++ b/tests/btrfs/214
@@ -6,22 +6,14 @@
#
# Test if the file capabilities aren't lost after full and incremental send
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick send snapshot
-here=`pwd`
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "cleanup; exit \$status" 0 1 2 3 15
+_register_cleanup "cleanup"
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
_supported_fs btrfs
_require_scratch
_require_command "$SETCAP_PROG" setcap
diff --git a/tests/btrfs/215 b/tests/btrfs/215
index c4959061..b45bd520 100755
--- a/tests/btrfs/215
+++ b/tests/btrfs/215
@@ -8,28 +8,12 @@
# counters. This is fixed by the following linux kernel commit:
# 814723e0a55a ("btrfs: increment device corruption error in case of checksum error")
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
get_physical()
{
diff --git a/tests/btrfs/216 b/tests/btrfs/216
index da596663..38efa0f5 100755
--- a/tests/btrfs/216
+++ b/tests/btrfs/216
@@ -9,27 +9,11 @@
# Fixed in kernel patch:
# btrfs: btrfs_show_devname don't traverse into the seed fsid
-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/preamble
+_begin_fstest auto quick seed
-# remove previous $seqres.full before test
-rm -f $seqres.full
+# Import common functions.
+. ./common/filter
# real QA test starts here
_supported_fs btrfs
diff --git a/tests/btrfs/217 b/tests/btrfs/217
index 8f2ce511..92bbba23 100755
--- a/tests/btrfs/217
+++ b/tests/btrfs/217
@@ -9,27 +9,11 @@
# - shrink device
# - fstrim
#
-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/preamble
+_begin_fstest auto quick trim dangerous
-# remove previous $seqres.full before test
-rm -f $seqres.full
+# Import common functions.
+. ./common/filter
# real QA test starts here
@@ -46,7 +30,6 @@ _scratch_mount
$FSTRIM_PROG -v $SCRATCH_MNT >> $seqres.full 2>&1 || \
_notrun "FSTRIM not supported"
-
# Shrink the fs to 4G, so the existing CHUNK_TRIMMED bits are beyond
# device boundary
$BTRFS_UTIL_PROG filesystem resize 1:-1G "$SCRATCH_MNT" >> $seqres.full
diff --git a/tests/btrfs/218 b/tests/btrfs/218
index d04d2b4e..5af54f3b 100755
--- a/tests/btrfs/218
+++ b/tests/btrfs/218
@@ -11,29 +11,13 @@
# Make a seed device, add a sprout to it, and then make sure we can still read
# the device stats for both devices after we remount with the new sprout device.
#
-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
. ./common/filter.btrfs
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/219 b/tests/btrfs/219
index bff6003e..528175b8 100755
--- a/tests/btrfs/219
+++ b/tests/btrfs/219
@@ -14,15 +14,10 @@
# currently.
#
-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 quick volume
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -38,13 +33,9 @@ _cleanup()
_btrfs_rescan_devices
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
diff --git a/tests/btrfs/220 b/tests/btrfs/220
index c84c7065..9991e6eb 100755
--- a/tests/btrfs/220
+++ b/tests/btrfs/220
@@ -7,22 +7,14 @@
# Test all existent mount options of btrfs
# * device= argument is already being test by btrfs/125
# * space cache test already covered by test btrfs/131
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick
-here=`pwd`
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "cleanup; exit \$status" 0 1 2 3 15
+_register_cleanup "cleanup"
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
_supported_fs btrfs
_require_scratch
diff --git a/tests/btrfs/221 b/tests/btrfs/221
index a482d0c5..a3007587 100755
--- a/tests/btrfs/221
+++ b/tests/btrfs/221
@@ -10,14 +10,10 @@
# one file has its name and location swapped with a directory for which it used
# to have a directory entry in it.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -25,8 +21,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -37,7 +32,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/222 b/tests/btrfs/222
index 51fd052a..f4524764 100755
--- a/tests/btrfs/222
+++ b/tests/btrfs/222
@@ -9,14 +9,10 @@
# two other inodes that correspond to different directories, and one of these
# directories is the parent of the other directory.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -24,8 +20,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -36,7 +31,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/223 b/tests/btrfs/223
index d8529262..af072ede 100755
--- a/tests/btrfs/223
+++ b/tests/btrfs/223
@@ -9,22 +9,10 @@
# allocated chunks in the new device were not trim/discarded by mounting the
# new device only in degraded mode, as this is the easiest way to verify it.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick replace trim
-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
@@ -32,8 +20,6 @@ _supported_fs btrfs
_require_scratch_dev_pool 3
_require_command "$WIPEFS_PROG" wipefs
-rm -f $seqres.full
-
_scratch_dev_pool_get 2
_spare_dev_get
dev1=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{ print $1 }')
diff --git a/tests/btrfs/224 b/tests/btrfs/224
index ecf6a468..d7ec5736 100755
--- a/tests/btrfs/224
+++ b/tests/btrfs/224
@@ -6,29 +6,13 @@
#
# Test the assign functionality of qgroups
#
-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
. ./common/reflink
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
@@ -102,7 +86,6 @@ snapshot_test()
_check_scratch_fs
}
-
assign_no_shared_test
assign_shared_test
diff --git a/tests/btrfs/225 b/tests/btrfs/225
index b745b536..408c03d2 100755
--- a/tests/btrfs/225
+++ b/tests/btrfs/225
@@ -12,15 +12,10 @@
# Create a seed FS. Add a RW device to make it sprout FS and then delete
# the seed device.
-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 quick volume seed
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -28,13 +23,9 @@ _cleanup()
_btrfs_rescan_devices
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/226 b/tests/btrfs/226
index c523cf4a..7034fcc7 100755
--- a/tests/btrfs/226
+++ b/tests/btrfs/226
@@ -7,22 +7,10 @@
# Test several (btrfs specific) scenarios with RWF_NOWAIT writes, cases where
# they should fail and cases where they should succeed.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-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/preamble
+_begin_fstest auto quick rw snapshot clone prealloc punch
+
+# Import common functions.
. ./common/filter
. ./common/reflink
@@ -35,8 +23,6 @@ _require_xfs_io_command pwrite -N
_require_xfs_io_command falloc -k
_require_xfs_io_command fpunch
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
diff --git a/tests/btrfs/227 b/tests/btrfs/227
index 1cf63c85..c881ab98 100755
--- a/tests/btrfs/227
+++ b/tests/btrfs/227
@@ -9,14 +9,10 @@
# filesystem, mounting the filesystem again and creating a new file (or
# directory).
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -24,8 +20,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -36,7 +31,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/228 b/tests/btrfs/228
index 346dca64..fde623fc 100755
--- a/tests/btrfs/228
+++ b/tests/btrfs/228
@@ -6,28 +6,12 @@
#
# Test correct operation of free objectid related functionality
#
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
# Modify as appropriate.
diff --git a/tests/btrfs/229 b/tests/btrfs/229
index 19026f2d..6c8c8193 100755
--- a/tests/btrfs/229
+++ b/tests/btrfs/229
@@ -9,14 +9,10 @@
# different offsets, and a large part of that extent was overwritten, so all the
# reflinks only point to subranges of the extent.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send clone
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -24,8 +20,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/reflink
@@ -36,7 +31,6 @@ _require_scratch_reflink
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/230 b/tests/btrfs/230
index 82b28ac1..2daacfbe 100755
--- a/tests/btrfs/230
+++ b/tests/btrfs/230
@@ -7,27 +7,11 @@
# Test if btrfs qgroup would crash if we're modifying the fs
# after exceeding the limit
#
-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/preamble
+_begin_fstest auto quick qgroup limit
-# remove previous $seqres.full before test
-rm -f $seqres.full
+# Import common functions.
+. ./common/filter
# real QA test starts here
diff --git a/tests/btrfs/231 b/tests/btrfs/231
index eb35e0e9..562f1fff 100755
--- a/tests/btrfs/231
+++ b/tests/btrfs/231
@@ -10,13 +10,10 @@
# and we do not get stale data corresponding to file extents that existed before
# truncating the file.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick clone log replay
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
@@ -24,8 +21,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmflakey
@@ -36,8 +32,6 @@ _require_btrfs_fs_feature "no_holes"
_require_btrfs_mkfs_feature "no-holes"
_require_dm_target flakey
-rm -f $seqres.full
-
_scratch_mkfs -O no-holes >>$seqres.full 2>&1
_require_metadata_journaling $SCRATCH_DEV
_init_flakey
diff --git a/tests/btrfs/232 b/tests/btrfs/232
index b9841410..8691a508 100755
--- a/tests/btrfs/232
+++ b/tests/btrfs/232
@@ -11,23 +11,10 @@
# reservation errors")
# 4d14c5cde5c2 ("btrfs: don't flush from btrfs_delayed_inode_reserve_metadata")
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick qgroup limit
-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
writer()
@@ -42,9 +29,6 @@ writer()
done
}
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
diff --git a/tests/btrfs/233 b/tests/btrfs/233
index 10e77358..f3e3762c 100755
--- a/tests/btrfs/233
+++ b/tests/btrfs/233
@@ -8,13 +8,10 @@
# on RO mounts and that after remounting a filesystem from RO to RW mode, it is
# performed.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick subvolume
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
@@ -22,8 +19,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmflakey
@@ -33,8 +29,6 @@ _require_scratch
_require_dm_target flakey
_require_btrfs_command inspect-internal dump-tree
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_require_metadata_journaling $SCRATCH_DEV
_init_flakey
diff --git a/tests/btrfs/234 b/tests/btrfs/234
index df64e54e..c045ea6c 100755
--- a/tests/btrfs/234
+++ b/tests/btrfs/234
@@ -7,22 +7,10 @@
# Test cases where a direct IO write, with O_DSYNC, can not be done and has to
# fallback to a buffered write.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick compress rw
-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
. ./common/attr
@@ -32,8 +20,6 @@ _require_scratch
_require_odirect
_require_chattr c
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
diff --git a/tests/btrfs/235 b/tests/btrfs/235
index 600dad95..cfa7603c 100755
--- a/tests/btrfs/235
+++ b/tests/btrfs/235
@@ -8,14 +8,10 @@
# send/receive operations only apply the capability to the first file, the one
# for which we have set a capability.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -23,8 +19,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -36,7 +31,6 @@ _require_command "$GETCAP_PROG" getcap
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir
diff --git a/tests/btrfs/236 b/tests/btrfs/236
index 58c86427..a16a1ce6 100755
--- a/tests/btrfs/236
+++ b/tests/btrfs/236
@@ -8,13 +8,10 @@
# previous fsync of another file, as well as that mtime and ctime are correct.
# Test both with COW and NOCOW writes.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick log
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
@@ -22,8 +19,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmflakey
@@ -32,8 +28,6 @@ _supported_fs btrfs
_require_scratch
_require_dm_target flakey
-rm -f $seqres.full
-
# The comments inside the function mentioning specific inode numbers and IDs
# (transactions, log commits, etc) are for the case where the function is run
# on a freshly created filesystem, but the logic and reasoning still applies
diff --git a/tests/btrfs/237 b/tests/btrfs/237
index da0c2d6c..5994edf8 100755
--- a/tests/btrfs/237
+++ b/tests/btrfs/237
@@ -9,28 +9,12 @@
# old block group gets deleted. On block group deletion, the underlying device
# zone also needs to be reset.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/preamble
+_begin_fstest auto quick zone balance
-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
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
# real QA test starts here
_supported_fs btrfs
diff --git a/tests/btrfs/238 b/tests/btrfs/238
index bbb06d3f..2622f353 100755
--- a/tests/btrfs/238
+++ b/tests/btrfs/238
@@ -9,27 +9,11 @@
# Kernel bug is fixed by the commit:
# btrfs: fix unmountable seed device after fstrim
-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/preamble
+_begin_fstest auto quick seed trim
-# remove previous $seqres.full before test
-rm -f $seqres.full
+# Import common functions.
+. ./common/filter
# real QA test starts here
diff --git a/tests/btrfs/239 b/tests/btrfs/239
index 479205c0..3fbeaedd 100755
--- a/tests/btrfs/239
+++ b/tests/btrfs/239
@@ -10,13 +10,10 @@
# we are able to mount the filesystem and that the moved directory exists only
# as a child of the directory we moved it into.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick log
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
@@ -24,8 +21,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmflakey
@@ -34,8 +30,6 @@ _supported_fs btrfs
_require_scratch
_require_dm_target flakey
-rm -f $seqres.full
-
# The test requires a very specific layout of keys and items in the fs/subvolume
# btree to trigger a bug. So we want to make sure that on whatever platform we
# are, we have the same leaf/node size.
diff --git a/tests/btrfs/240 b/tests/btrfs/240
index c799848f..afc6aae0 100755
--- a/tests/btrfs/240
+++ b/tests/btrfs/240
@@ -10,13 +10,10 @@
# failure on the last fsync and turn the filesystem to RO mode because of a
# transaction abort.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick prealloc log
+# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
@@ -24,8 +21,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
. ./common/dmflakey
@@ -35,14 +31,11 @@ _require_scratch
_require_dm_target flakey
_require_xfs_io_command "falloc"
-rm -f $seqres.full
-
_scratch_mkfs >>$seqres.full 2>&1
_require_metadata_journaling $SCRATCH_DEV
_init_flakey
_mount_flakey
-
# Create our test file with 2 preallocated extents. Leave a 1M hole between them
# to ensure that we get two file extent items that will never be merged into a
# single one. The extents are contiguous on disk, which will later result in the
diff --git a/tests/btrfs/241 b/tests/btrfs/241
index 96f2e190..d7348edf 100755
--- a/tests/btrfs/241
+++ b/tests/btrfs/241
@@ -10,14 +10,10 @@
# of a directory and another name (hardlink) with the old name and location of
# another file that was located in that same directory.
#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+. ./common/preamble
+_begin_fstest auto quick send
+# Override the default cleanup function.
_cleanup()
{
cd /
@@ -25,8 +21,7 @@ _cleanup()
rm -f $tmp.*
}
-# get standard environment, filters and checks
-. ./common/rc
+# Import common functions.
. ./common/filter
# real QA test starts here
@@ -37,7 +32,6 @@ _require_fssum
send_files_dir=$TEST_DIR/btrfs-test-$seq
-rm -f $seqres.full
rm -fr $send_files_dir
mkdir $send_files_dir