diff mbox series

[4/6] check: don't abort on non-existent excluded groups

Message ID 161292580215.3504537.12419725496679954055.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series fstests: various improvements to the test framework | expand

Commit Message

Darrick J. Wong Feb. 10, 2021, 2:56 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Don't abort the whole test run if we asked to exclude groups that aren't
included in the candidate group list, since we actually /are/ satisfying
the user's request.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 check |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Brian Foster Feb. 11, 2021, 2 p.m. UTC | #1
On Tue, Feb 09, 2021 at 06:56:42PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Don't abort the whole test run if we asked to exclude groups that aren't
> included in the candidate group list, since we actually /are/ satisfying
> the user's request.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  check |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> diff --git a/check b/check
> index e51cbede..6f8db858 100755
> --- a/check
> +++ b/check
> @@ -243,7 +243,7 @@ _prepare_test_list()
>  		list=$(get_group_list $xgroup)
>  		if [ -z "$list" ]; then
>  			echo "Group \"$xgroup\" is empty or not defined?"
> -			exit 1
> +			continue
>  		fi

Is this only for a nonexistent group? I.e., 'check -x nosuchgroup ...' ?
If so, what's the advantage?

Brian

>  
>  		trim_test_list $list
>
Darrick J. Wong Feb. 11, 2021, 5:27 p.m. UTC | #2
On Thu, Feb 11, 2021 at 09:00:19AM -0500, Brian Foster wrote:
> On Tue, Feb 09, 2021 at 06:56:42PM -0800, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > Don't abort the whole test run if we asked to exclude groups that aren't
> > included in the candidate group list, since we actually /are/ satisfying
> > the user's request.
> > 
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
> >  check |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > 
> > diff --git a/check b/check
> > index e51cbede..6f8db858 100755
> > --- a/check
> > +++ b/check
> > @@ -243,7 +243,7 @@ _prepare_test_list()
> >  		list=$(get_group_list $xgroup)
> >  		if [ -z "$list" ]; then
> >  			echo "Group \"$xgroup\" is empty or not defined?"
> > -			exit 1
> > +			continue
> >  		fi
> 
> Is this only for a nonexistent group? I.e., 'check -x nosuchgroup ...' ?
> If so, what's the advantage?

I wrote this for groups that exist somewhere but would never have been
selected for this filesystem type in the first place.  For example,
'dangerous_scrub' (aka fuzz testing for xfs_scrub) is only found in
tests/xfs/group, so running:

# FSTYP=ext4 ./check -x dangerous_scrub

fails because ./check cannot select any of the dangerous_scrub tests for
an ext4 run so it doesn't recognize the group name.  IOWs, it's too
stupid to realize that excluding a group that can't be selected should
be a no-op.

--D

> Brian
> 
> >  
> >  		trim_test_list $list
> > 
>
Brian Foster Feb. 11, 2021, 6:01 p.m. UTC | #3
On Thu, Feb 11, 2021 at 09:27:05AM -0800, Darrick J. Wong wrote:
> On Thu, Feb 11, 2021 at 09:00:19AM -0500, Brian Foster wrote:
> > On Tue, Feb 09, 2021 at 06:56:42PM -0800, Darrick J. Wong wrote:
> > > From: Darrick J. Wong <djwong@kernel.org>
> > > 
> > > Don't abort the whole test run if we asked to exclude groups that aren't
> > > included in the candidate group list, since we actually /are/ satisfying
> > > the user's request.
> > > 
> > > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > > ---
> > >  check |    2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > 
> > > diff --git a/check b/check
> > > index e51cbede..6f8db858 100755
> > > --- a/check
> > > +++ b/check
> > > @@ -243,7 +243,7 @@ _prepare_test_list()
> > >  		list=$(get_group_list $xgroup)
> > >  		if [ -z "$list" ]; then
> > >  			echo "Group \"$xgroup\" is empty or not defined?"
> > > -			exit 1
> > > +			continue
> > >  		fi
> > 
> > Is this only for a nonexistent group? I.e., 'check -x nosuchgroup ...' ?
> > If so, what's the advantage?
> 
> I wrote this for groups that exist somewhere but would never have been
> selected for this filesystem type in the first place.  For example,
> 'dangerous_scrub' (aka fuzz testing for xfs_scrub) is only found in
> tests/xfs/group, so running:
> 
> # FSTYP=ext4 ./check -x dangerous_scrub
> 
> fails because ./check cannot select any of the dangerous_scrub tests for
> an ext4 run so it doesn't recognize the group name.  IOWs, it's too
> stupid to realize that excluding a group that can't be selected should
> be a no-op.
> 

Ah, I see. Seems reasonable enough:

Reviewed-by: Brian Foster <bfoster@redhat.com>

> --D
> 
> > Brian
> > 
> > >  
> > >  		trim_test_list $list
> > > 
> > 
>
diff mbox series

Patch

diff --git a/check b/check
index e51cbede..6f8db858 100755
--- a/check
+++ b/check
@@ -243,7 +243,7 @@  _prepare_test_list()
 		list=$(get_group_list $xgroup)
 		if [ -z "$list" ]; then
 			echo "Group \"$xgroup\" is empty or not defined?"
-			exit 1
+			continue
 		fi
 
 		trim_test_list $list