linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET 0/1] fstests: fixes for test control code
@ 2021-07-07  0:20 Darrick J. Wong
  2021-07-07  0:21 ` [PATCH 1/1] new: allow users to specify a new test id Darrick J. Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Darrick J. Wong @ 2021-07-07  0:20 UTC (permalink / raw)
  To: djwong, guaneryu; +Cc: linux-xfs, fstests, guan

Hi all,

Here is one more fix for problems in fstests itself, which teaches ./new
to take a new test number when creating a test.  Most people will want
it to pick one, but for those who want to create a large number of tests
now that are numbered high enough to avoid conflicts with future
rebases, this feature is for you!

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=fstests-fixes
---
 new |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] new: allow users to specify a new test id
  2021-07-07  0:20 [PATCHSET 0/1] fstests: fixes for test control code Darrick J. Wong
@ 2021-07-07  0:21 ` Darrick J. Wong
  2021-07-18 13:57   ` Eryu Guan
  0 siblings, 1 reply; 6+ messages in thread
From: Darrick J. Wong @ 2021-07-07  0:21 UTC (permalink / raw)
  To: djwong, guaneryu; +Cc: linux-xfs, fstests, guan

From: Darrick J. Wong <djwong@kernel.org>

Alter the ./new script so that one can set the test id explicitly.

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


diff --git a/new b/new
index 07144399..51111f08 100755
--- a/new
+++ b/new
@@ -26,7 +26,18 @@ usage()
 }
 
 [ $# -eq 0 ] && usage
-tdir=tests/$1
+
+if echo "$1" | grep -q '/'; then
+	if [ -e "tests/$1" ]; then
+		echo "$1: test already exists."
+		exit 1
+	fi
+	tdir="tests/$(echo "$1" | cut -d '/' -f 1)"
+	id="$(echo "$1" | cut -d '/' -f 2)"
+else
+	tdir=tests/$1
+	id="$(basename "$(./tools/nextid "$1")")"
+fi
 
 i=0
 line=0
@@ -36,7 +47,6 @@ eof=1
 export AWK_PROG="$(type -P awk)"
 [ "$AWK_PROG" = "" ] && { echo "awk not found"; exit; }
 
-id="$(basename "$(./tools/nextid "$1")")"
 echo "Next test id is $id"
 shift
 


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] new: allow users to specify a new test id
  2021-07-07  0:21 ` [PATCH 1/1] new: allow users to specify a new test id Darrick J. Wong
@ 2021-07-18 13:57   ` Eryu Guan
  2021-07-18 16:23     ` Darrick J. Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Eryu Guan @ 2021-07-18 13:57 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests

On Tue, Jul 06, 2021 at 05:21:04PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Alter the ./new script so that one can set the test id explicitly.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>

Looks good to me. Mind updating the usage info as well?

Thanks,
Eryu

> ---
>  new |   14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> 
> diff --git a/new b/new
> index 07144399..51111f08 100755
> --- a/new
> +++ b/new
> @@ -26,7 +26,18 @@ usage()
>  }
>  
>  [ $# -eq 0 ] && usage
> -tdir=tests/$1
> +
> +if echo "$1" | grep -q '/'; then
> +	if [ -e "tests/$1" ]; then
> +		echo "$1: test already exists."
> +		exit 1
> +	fi
> +	tdir="tests/$(echo "$1" | cut -d '/' -f 1)"
> +	id="$(echo "$1" | cut -d '/' -f 2)"
> +else
> +	tdir=tests/$1
> +	id="$(basename "$(./tools/nextid "$1")")"
> +fi
>  
>  i=0
>  line=0
> @@ -36,7 +47,6 @@ eof=1
>  export AWK_PROG="$(type -P awk)"
>  [ "$AWK_PROG" = "" ] && { echo "awk not found"; exit; }
>  
> -id="$(basename "$(./tools/nextid "$1")")"
>  echo "Next test id is $id"
>  shift
>  

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] new: allow users to specify a new test id
  2021-07-18 13:57   ` Eryu Guan
@ 2021-07-18 16:23     ` Darrick J. Wong
  0 siblings, 0 replies; 6+ messages in thread
From: Darrick J. Wong @ 2021-07-18 16:23 UTC (permalink / raw)
  To: Eryu Guan; +Cc: guaneryu, linux-xfs, fstests

On Sun, Jul 18, 2021 at 09:57:14PM +0800, Eryu Guan wrote:
> On Tue, Jul 06, 2021 at 05:21:04PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > Alter the ./new script so that one can set the test id explicitly.
> > 
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> 
> Looks good to me. Mind updating the usage info as well?

Will do and resubmit.  Thanks for reviewing the rest of the patches. :)

--D

> 
> Thanks,
> Eryu
> 
> > ---
> >  new |   14 ++++++++++++--
> >  1 file changed, 12 insertions(+), 2 deletions(-)
> > 
> > 
> > diff --git a/new b/new
> > index 07144399..51111f08 100755
> > --- a/new
> > +++ b/new
> > @@ -26,7 +26,18 @@ usage()
> >  }
> >  
> >  [ $# -eq 0 ] && usage
> > -tdir=tests/$1
> > +
> > +if echo "$1" | grep -q '/'; then
> > +	if [ -e "tests/$1" ]; then
> > +		echo "$1: test already exists."
> > +		exit 1
> > +	fi
> > +	tdir="tests/$(echo "$1" | cut -d '/' -f 1)"
> > +	id="$(echo "$1" | cut -d '/' -f 2)"
> > +else
> > +	tdir=tests/$1
> > +	id="$(basename "$(./tools/nextid "$1")")"
> > +fi
> >  
> >  i=0
> >  line=0
> > @@ -36,7 +47,6 @@ eof=1
> >  export AWK_PROG="$(type -P awk)"
> >  [ "$AWK_PROG" = "" ] && { echo "awk not found"; exit; }
> >  
> > -id="$(basename "$(./tools/nextid "$1")")"
> >  echo "Next test id is $id"
> >  shift
> >  

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] new: allow users to specify a new test id
  2021-07-20  1:08 ` [PATCH 1/1] new: allow users to specify a new test id Darrick J. Wong
@ 2021-07-22  6:35   ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2021-07-22  6:35 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests, guan

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] new: allow users to specify a new test id
  2021-07-20  1:08 [PATCHSET v2 0/1] fstests: fixes for test control code Darrick J. Wong
@ 2021-07-20  1:08 ` Darrick J. Wong
  2021-07-22  6:35   ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: Darrick J. Wong @ 2021-07-20  1:08 UTC (permalink / raw)
  To: djwong, guaneryu; +Cc: linux-xfs, fstests, guan

From: Darrick J. Wong <djwong@kernel.org>

Alter the ./new script so that one can set the test id explicitly.

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


diff --git a/new b/new
index 07144399..2097a883 100755
--- a/new
+++ b/new
@@ -20,13 +20,24 @@ _cleanup()
 SRC_GROUPS=`find tests -not -path tests -type d -printf "%f "`
 usage()
 {
-    echo "Usage $0 test_dir"
+    echo "Usage $0 test_dir|test_dir_and_name"
     echo "Available dirs are: $SRC_GROUPS"
     exit
 }
 
 [ $# -eq 0 ] && usage
-tdir=tests/$1
+
+if echo "$1" | grep -q '/'; then
+	if [ -e "tests/$1" ]; then
+		echo "$1: test already exists."
+		exit 1
+	fi
+	tdir="tests/$(echo "$1" | cut -d '/' -f 1)"
+	id="$(echo "$1" | cut -d '/' -f 2)"
+else
+	tdir=tests/$1
+	id="$(basename "$(./tools/nextid "$1")")"
+fi
 
 i=0
 line=0
@@ -36,7 +47,6 @@ eof=1
 export AWK_PROG="$(type -P awk)"
 [ "$AWK_PROG" = "" ] && { echo "awk not found"; exit; }
 
-id="$(basename "$(./tools/nextid "$1")")"
 echo "Next test id is $id"
 shift
 


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-22  6:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07  0:20 [PATCHSET 0/1] fstests: fixes for test control code Darrick J. Wong
2021-07-07  0:21 ` [PATCH 1/1] new: allow users to specify a new test id Darrick J. Wong
2021-07-18 13:57   ` Eryu Guan
2021-07-18 16:23     ` Darrick J. Wong
2021-07-20  1:08 [PATCHSET v2 0/1] fstests: fixes for test control code Darrick J. Wong
2021-07-20  1:08 ` [PATCH 1/1] new: allow users to specify a new test id Darrick J. Wong
2021-07-22  6:35   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).