diff mbox series

[9/9] new: don't allow new tests in group 'other'

Message ID 163174940659.380880.14564845266535022734.stgit@magnolia (mailing list archive)
State Superseded
Headers show
Series fstests: document all test groups | expand

Commit Message

Darrick J. Wong Sept. 15, 2021, 11:43 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

The 'other' group is vaguely defined at best -- other than what?  It's
not clear what tests belong in this group, and it has become a dumping
ground for random stuff that are classified in other groups.  Don't let
people create new other group tests.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 new |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Amir Goldstein Sept. 16, 2021, 6:40 a.m. UTC | #1
On Thu, Sep 16, 2021 at 2:43 AM Darrick J. Wong <djwong@kernel.org> wrote:
>
> From: Darrick J. Wong <djwong@kernel.org>
>
> The 'other' group is vaguely defined at best -- other than what?  It's
> not clear what tests belong in this group, and it has become a dumping
> ground for random stuff that are classified in other groups.  Don't let
> people create new other group tests.
>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  new |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
>
> diff --git a/new b/new
> index 6b7dc5d4..5cf96c50 100755
> --- a/new
> +++ b/new
> @@ -96,9 +96,9 @@ then
>
>      while true
>      do
> -       echo -n "Add to group(s) [other] (separate by space, ? for list): "
> +       echo -n "Add to group(s) [auto] (separate by space, ? for list): "
>         read ans
> -       [ -z "$ans" ] && ans=other
> +       [ -z "$ans" ] && ans=auto
>         if [ "X$ans" = "X?" ]
>         then
>             echo $(group_names)
> @@ -109,6 +109,9 @@ then
>                 echo "Invalid characters in group(s): $inval"
>                 echo "Only lower cases, digits and underscore are allowed in groups, separated by space"
>                 continue
> +           elif echo "$ans" | grep -q -w "other"; then
> +               echo "Do not add more tests to group \"other\"."
> +               continue

Should we also filter out "other" from group_names(), so it is not listed
for "?"?
With this patch, "other" does not emit a warning when passed in as a script
command line argument.
If we filter "other" from group_names(), then the warning in "expert mode"
will be a bit confusing (group "other" not defined in documentation).

Also, it is not clear to me if this is intentional behavior that interactive
mode allows non-dcumented groups (with valid chars validation) and
expert mode does not allow non-documented groups?

It may be simpler to use the same helper in both modes (is_group_valid)
to emit the correct warning and either proceed (expert mode) or get
back to prompt (interactive mode).

Thanks,
Amir.
Darrick J. Wong Sept. 16, 2021, 10:53 p.m. UTC | #2
On Thu, Sep 16, 2021 at 09:40:54AM +0300, Amir Goldstein wrote:
> On Thu, Sep 16, 2021 at 2:43 AM Darrick J. Wong <djwong@kernel.org> wrote:
> >
> > From: Darrick J. Wong <djwong@kernel.org>
> >
> > The 'other' group is vaguely defined at best -- other than what?  It's
> > not clear what tests belong in this group, and it has become a dumping
> > ground for random stuff that are classified in other groups.  Don't let
> > people create new other group tests.
> >
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
> >  new |    7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> >
> >
> > diff --git a/new b/new
> > index 6b7dc5d4..5cf96c50 100755
> > --- a/new
> > +++ b/new
> > @@ -96,9 +96,9 @@ then
> >
> >      while true
> >      do
> > -       echo -n "Add to group(s) [other] (separate by space, ? for list): "
> > +       echo -n "Add to group(s) [auto] (separate by space, ? for list): "
> >         read ans
> > -       [ -z "$ans" ] && ans=other
> > +       [ -z "$ans" ] && ans=auto
> >         if [ "X$ans" = "X?" ]
> >         then
> >             echo $(group_names)
> > @@ -109,6 +109,9 @@ then
> >                 echo "Invalid characters in group(s): $inval"
> >                 echo "Only lower cases, digits and underscore are allowed in groups, separated by space"
> >                 continue
> > +           elif echo "$ans" | grep -q -w "other"; then
> > +               echo "Do not add more tests to group \"other\"."
> > +               continue
> 
> Should we also filter out "other" from group_names(), so it is not listed
> for "?"?

No; there are drawbacks to that, as you point out below.

> With this patch, "other" does not emit a warning when passed in as a script
> command line argument.

Done.

> If we filter "other" from group_names(), then the warning in "expert mode"
> will be a bit confusing (group "other" not defined in documentation).

I will filter it out in the specific case case that the interactive user
specified "?" to list the groups.

> Also, it is not clear to me if this is intentional behavior that interactive
> mode allows non-dcumented groups (with valid chars validation) and
> expert mode does not allow non-documented groups?

Probably not.

> It may be simpler to use the same helper in both modes (is_group_valid)
> to emit the correct warning and either proceed (expert mode) or get
> back to prompt (interactive mode).

This is getting farther afield from where I wanted this thing to go.
Very well, I'll split the ./new cleanups into its own series, but TBH
I've gotten tired of people asking for more and more cleanups out of me.

--D

> Thanks,
> Amir.
Amir Goldstein Sept. 17, 2021, 2:31 a.m. UTC | #3
On Fri, Sep 17, 2021 at 1:53 AM Darrick J. Wong <djwong@kernel.org> wrote:
>
> On Thu, Sep 16, 2021 at 09:40:54AM +0300, Amir Goldstein wrote:
> > On Thu, Sep 16, 2021 at 2:43 AM Darrick J. Wong <djwong@kernel.org> wrote:
> > >
> > > From: Darrick J. Wong <djwong@kernel.org>
> > >
> > > The 'other' group is vaguely defined at best -- other than what?  It's
> > > not clear what tests belong in this group, and it has become a dumping
> > > ground for random stuff that are classified in other groups.  Don't let
> > > people create new other group tests.
> > >
> > > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > > ---
> > >  new |    7 +++++--
> > >  1 file changed, 5 insertions(+), 2 deletions(-)
> > >
> > >
> > > diff --git a/new b/new
> > > index 6b7dc5d4..5cf96c50 100755
> > > --- a/new
> > > +++ b/new
> > > @@ -96,9 +96,9 @@ then
> > >
> > >      while true
> > >      do
> > > -       echo -n "Add to group(s) [other] (separate by space, ? for list): "
> > > +       echo -n "Add to group(s) [auto] (separate by space, ? for list): "
> > >         read ans
> > > -       [ -z "$ans" ] && ans=other
> > > +       [ -z "$ans" ] && ans=auto
> > >         if [ "X$ans" = "X?" ]
> > >         then
> > >             echo $(group_names)
> > > @@ -109,6 +109,9 @@ then
> > >                 echo "Invalid characters in group(s): $inval"
> > >                 echo "Only lower cases, digits and underscore are allowed in groups, separated by space"
> > >                 continue
> > > +           elif echo "$ans" | grep -q -w "other"; then
> > > +               echo "Do not add more tests to group \"other\"."
> > > +               continue
> >
> > Should we also filter out "other" from group_names(), so it is not listed
> > for "?"?
>
> No; there are drawbacks to that, as you point out below.
>
> > With this patch, "other" does not emit a warning when passed in as a script
> > command line argument.
>
> Done.
>
> > If we filter "other" from group_names(), then the warning in "expert mode"
> > will be a bit confusing (group "other" not defined in documentation).
>
> I will filter it out in the specific case case that the interactive user
> specified "?" to list the groups.
>
> > Also, it is not clear to me if this is intentional behavior that interactive
> > mode allows non-dcumented groups (with valid chars validation) and
> > expert mode does not allow non-documented groups?
>
> Probably not.
>
> > It may be simpler to use the same helper in both modes (is_group_valid)
> > to emit the correct warning and either proceed (expert mode) or get
> > back to prompt (interactive mode).
>
> This is getting farther afield from where I wanted this thing to go.
> Very well, I'll split the ./new cleanups into its own series, but TBH
> I've gotten tired of people asking for more and more cleanups out of me.
>

Fair enough.
TBH I just wanted to point out the inconsistencies that I noticed.
I don't really mind if they are fixed.
I should have been more clear about this point.

Thanks,
Amir.
Darrick J. Wong Sept. 17, 2021, 4 p.m. UTC | #4
On Fri, Sep 17, 2021 at 05:31:25AM +0300, Amir Goldstein wrote:
> On Fri, Sep 17, 2021 at 1:53 AM Darrick J. Wong <djwong@kernel.org> wrote:
> >
> > On Thu, Sep 16, 2021 at 09:40:54AM +0300, Amir Goldstein wrote:
> > > On Thu, Sep 16, 2021 at 2:43 AM Darrick J. Wong <djwong@kernel.org> wrote:
> > > >
> > > > From: Darrick J. Wong <djwong@kernel.org>
> > > >
> > > > The 'other' group is vaguely defined at best -- other than what?  It's
> > > > not clear what tests belong in this group, and it has become a dumping
> > > > ground for random stuff that are classified in other groups.  Don't let
> > > > people create new other group tests.
> > > >
> > > > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > > > ---
> > > >  new |    7 +++++--
> > > >  1 file changed, 5 insertions(+), 2 deletions(-)
> > > >
> > > >
> > > > diff --git a/new b/new
> > > > index 6b7dc5d4..5cf96c50 100755
> > > > --- a/new
> > > > +++ b/new
> > > > @@ -96,9 +96,9 @@ then
> > > >
> > > >      while true
> > > >      do
> > > > -       echo -n "Add to group(s) [other] (separate by space, ? for list): "
> > > > +       echo -n "Add to group(s) [auto] (separate by space, ? for list): "
> > > >         read ans
> > > > -       [ -z "$ans" ] && ans=other
> > > > +       [ -z "$ans" ] && ans=auto
> > > >         if [ "X$ans" = "X?" ]
> > > >         then
> > > >             echo $(group_names)
> > > > @@ -109,6 +109,9 @@ then
> > > >                 echo "Invalid characters in group(s): $inval"
> > > >                 echo "Only lower cases, digits and underscore are allowed in groups, separated by space"
> > > >                 continue
> > > > +           elif echo "$ans" | grep -q -w "other"; then
> > > > +               echo "Do not add more tests to group \"other\"."
> > > > +               continue
> > >
> > > Should we also filter out "other" from group_names(), so it is not listed
> > > for "?"?
> >
> > No; there are drawbacks to that, as you point out below.
> >
> > > With this patch, "other" does not emit a warning when passed in as a script
> > > command line argument.
> >
> > Done.
> >
> > > If we filter "other" from group_names(), then the warning in "expert mode"
> > > will be a bit confusing (group "other" not defined in documentation).
> >
> > I will filter it out in the specific case case that the interactive user
> > specified "?" to list the groups.
> >
> > > Also, it is not clear to me if this is intentional behavior that interactive
> > > mode allows non-dcumented groups (with valid chars validation) and
> > > expert mode does not allow non-documented groups?
> >
> > Probably not.
> >
> > > It may be simpler to use the same helper in both modes (is_group_valid)
> > > to emit the correct warning and either proceed (expert mode) or get
> > > back to prompt (interactive mode).
> >
> > This is getting farther afield from where I wanted this thing to go.
> > Very well, I'll split the ./new cleanups into its own series, but TBH
> > I've gotten tired of people asking for more and more cleanups out of me.
> >
> 
> Fair enough.
> TBH I just wanted to point out the inconsistencies that I noticed.
> I don't really mind if they are fixed.
> I should have been more clear about this point.

Oh.  Well thank you for reviewing this series and the ./new cleanups. :)

--D

> Thanks,
> Amir.
diff mbox series

Patch

diff --git a/new b/new
index 6b7dc5d4..5cf96c50 100755
--- a/new
+++ b/new
@@ -96,9 +96,9 @@  then
 
     while true
     do
-	echo -n "Add to group(s) [other] (separate by space, ? for list): "
+	echo -n "Add to group(s) [auto] (separate by space, ? for list): "
 	read ans
-	[ -z "$ans" ] && ans=other
+	[ -z "$ans" ] && ans=auto
 	if [ "X$ans" = "X?" ]
 	then
 	    echo $(group_names)
@@ -109,6 +109,9 @@  then
 		echo "Invalid characters in group(s): $inval"
 		echo "Only lower cases, digits and underscore are allowed in groups, separated by space"
 		continue
+	    elif echo "$ans" | grep -q -w "other"; then
+		echo "Do not add more tests to group \"other\"."
+		continue
 	    else
 		# remove redundant spaces/tabs
 		ans=`echo "$ans" | sed 's/\s\+/ /g'`