diff mbox series

[04/10] fstests: move test group info to test files

Message ID 162199362461.3744214.7536635976092405399.stgit@locust (mailing list archive)
State New, archived
Headers show
Series fstests: move test group lists into test files | expand

Commit Message

Darrick J. Wong May 26, 2021, 1:47 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Migrate 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

(NOTE: I truncated this patch to the first five conversions because
nobody wants to read a 1MB patch LOL)

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/btrfs/001 |    8 ++------
 tests/btrfs/002 |    8 ++------
 tests/btrfs/003 |    8 ++------
 tests/btrfs/004 |    8 ++------
 4 files changed, 8 insertions(+), 24 deletions(-)

Comments

Eric Biggers June 3, 2021, 4:58 a.m. UTC | #1
On Tue, May 25, 2021 at 06:47:04PM -0700, Darrick J. Wong wrote:
> diff --git a/tests/btrfs/001 b/tests/btrfs/001
> index fb051e8a..2248b6f6 100755
> --- a/tests/btrfs/001
> +++ b/tests/btrfs/001
> @@ -6,13 +6,9 @@
>  #
>  # Test btrfs's subvolume and snapshot support
>  #
> -seq=`basename $0`
> -seqres=$RESULT_DIR/$seq
> -echo "QA output created by $seq"
> +. ./common/test_names
> +_set_seq_and_groups auto quick subvol snapshot

The naming is a little weird here.  This feels more like a common preamble,
especially given that it also sets $here, $tmp, and $status -- not just the test
groups.  Maybe it should look like:

. ./common/preamble
_begin_fstest quick subvol snapshot
Darrick J. Wong June 3, 2021, 3:23 p.m. UTC | #2
On Wed, Jun 02, 2021 at 09:58:03PM -0700, Eric Biggers wrote:
> On Tue, May 25, 2021 at 06:47:04PM -0700, Darrick J. Wong wrote:
> > diff --git a/tests/btrfs/001 b/tests/btrfs/001
> > index fb051e8a..2248b6f6 100755
> > --- a/tests/btrfs/001
> > +++ b/tests/btrfs/001
> > @@ -6,13 +6,9 @@
> >  #
> >  # Test btrfs's subvolume and snapshot support
> >  #
> > -seq=`basename $0`
> > -seqres=$RESULT_DIR/$seq
> > -echo "QA output created by $seq"
> > +. ./common/test_names
> > +_set_seq_and_groups auto quick subvol snapshot
> 
> The naming is a little weird here.  This feels more like a common preamble,
> especially given that it also sets $here, $tmp, and $status -- not just the test
> groups.  Maybe it should look like:
> 
> . ./common/preamble
> _begin_fstest quick subvol snapshot

I like that much better than my current names!  Will fix for v2.

--D
diff mbox series

Patch

diff --git a/tests/btrfs/001 b/tests/btrfs/001
index fb051e8a..2248b6f6 100755
--- a/tests/btrfs/001
+++ b/tests/btrfs/001
@@ -6,13 +6,9 @@ 
 #
 # Test btrfs's subvolume and snapshot support
 #
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/test_names
+_set_seq_and_groups auto quick subvol snapshot
 
-here=`pwd`
-tmp=/tmp/$$
-status=1	# failure is the default!
 
 _cleanup()
 {
diff --git a/tests/btrfs/002 b/tests/btrfs/002
index 66775562..4de0a3d7 100755
--- a/tests/btrfs/002
+++ b/tests/btrfs/002
@@ -6,13 +6,9 @@ 
 #
 # Extented btrfs snapshot test cases
 #
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/test_names
+_set_seq_and_groups auto snapshot
 
-here=`pwd`
-tmp=/tmp/$$
-status=1	# failure is the default!
 
 _cleanup()
 {
diff --git a/tests/btrfs/003 b/tests/btrfs/003
index fbb313fb..f1e06af5 100755
--- a/tests/btrfs/003
+++ b/tests/btrfs/003
@@ -6,13 +6,9 @@ 
 #
 # btrfs vol tests
 #
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
+. ./common/test_names
+_set_seq_and_groups 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
diff --git a/tests/btrfs/004 b/tests/btrfs/004
index 0458d2b6..d7071d80 100755
--- a/tests/btrfs/004
+++ b/tests/btrfs/004
@@ -9,13 +9,9 @@ 
 # 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/test_names
+_set_seq_and_groups auto rw metadata
 
-here=`pwd`
-tmp=/tmp/$$
-status=1
 noise_pid=0
 
 _cleanup()