* [PATCH v1 0/3] new: Improvements to new script
@ 2025-05-13 8:10 Nirjhar Roy (IBM)
2025-05-13 8:10 ` [PATCH v1 1/3] new: Add a new parameter (name/emailid) in the "new" script Nirjhar Roy (IBM)
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Nirjhar Roy (IBM) @ 2025-05-13 8:10 UTC (permalink / raw)
To: fstests
Cc: linux-ext4, linux-xfs, ritesh.list, ojaswin, djwong, zlang, david,
nirjhar.roy.lists
This series adds a couple of improvements to the "new" script.
Patch-1/3 - Adds an optional name/email id parameter prompt to the new script while creating
a new test file using the "new" file.
Patch 2/3 - Replace "status=0;exit 0" with _exit 0 in the skeleton file in "new".
Patch 3/3 - Add a make command after the skeleton file is created, so that once
the skeleton file is created, it automatically gets added to group.list file. This
will enable the users to directly run the test without having to explicitly run make
on their own.
Nirjhar Roy (IBM) (3):
new: Add a new parameter (name/emailid) in the "new" script
new: Replace "status=0; exit 0" with _exit 0
new: Run make after adding a new test file
new | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v1 1/3] new: Add a new parameter (name/emailid) in the "new" script
2025-05-13 8:10 [PATCH v1 0/3] new: Improvements to new script Nirjhar Roy (IBM)
@ 2025-05-13 8:10 ` Nirjhar Roy (IBM)
2025-05-14 5:36 ` Zorro Lang
2025-05-13 8:10 ` [PATCH v1 2/3] new: Replace "status=0; exit 0" with _exit 0 Nirjhar Roy (IBM)
2025-05-13 8:10 ` [PATCH v1 3/3] new: Run make after adding a new test file Nirjhar Roy (IBM)
2 siblings, 1 reply; 8+ messages in thread
From: Nirjhar Roy (IBM) @ 2025-05-13 8:10 UTC (permalink / raw)
To: fstests
Cc: linux-ext4, linux-xfs, ritesh.list, ojaswin, djwong, zlang, david,
nirjhar.roy.lists
This patch another optional interactive prompt to enter the
author name and email id for each new test file that is
created using the "new" file.
The sample output looks like something like the following:
./new selftest
Next test id is 007
Append a name to the ID? Test name will be 007-$name. y,[n]:
Creating test file '007'
Add to group(s) [auto] (separate by space, ? for list): selftest quick
Enter <author_name> <email-id>: Nirjhar Roy <nirjhar.roy.lists@gmail.com>
Creating skeletal script for you to edit ...
done.
...
...
Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
---
new | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/new b/new
index 6b50ffed..139715bf 100755
--- a/new
+++ b/new
@@ -136,6 +136,9 @@ else
check_groups "${new_groups[@]}" || exit 1
fi
+read -p "Enter <author_name> <email-id>: " -r
+author_name="${REPLY:=YOUR NAME HERE}"
+
echo -n "Creating skeletal script for you to edit ..."
year=`date +%Y`
@@ -143,7 +146,7 @@ year=`date +%Y`
cat <<End-of-File >$tdir/$id
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) $year YOUR NAME HERE. All Rights Reserved.
+# Copyright (c) $year $author_name. All Rights Reserved.
#
# FS QA Test $id
#
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v1 2/3] new: Replace "status=0; exit 0" with _exit 0
2025-05-13 8:10 [PATCH v1 0/3] new: Improvements to new script Nirjhar Roy (IBM)
2025-05-13 8:10 ` [PATCH v1 1/3] new: Add a new parameter (name/emailid) in the "new" script Nirjhar Roy (IBM)
@ 2025-05-13 8:10 ` Nirjhar Roy (IBM)
2025-05-14 5:20 ` Zorro Lang
2025-05-13 8:10 ` [PATCH v1 3/3] new: Run make after adding a new test file Nirjhar Roy (IBM)
2 siblings, 1 reply; 8+ messages in thread
From: Nirjhar Roy (IBM) @ 2025-05-13 8:10 UTC (permalink / raw)
To: fstests
Cc: linux-ext4, linux-xfs, ritesh.list, ojaswin, djwong, zlang, david,
nirjhar.roy.lists
We should now start using _exit 0 for every new test
that we add.
Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
---
new | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/new b/new
index 139715bf..e55830ce 100755
--- a/new
+++ b/new
@@ -176,8 +176,7 @@ exit
#echo "If failure, check \$seqres.full (this) and \$seqres.full.ok (reference)"
# success, all done
-status=0
-exit
+_exit 0
End-of-File
sleep 2 # latency to read messages to this point
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v1 3/3] new: Run make after adding a new test file
2025-05-13 8:10 [PATCH v1 0/3] new: Improvements to new script Nirjhar Roy (IBM)
2025-05-13 8:10 ` [PATCH v1 1/3] new: Add a new parameter (name/emailid) in the "new" script Nirjhar Roy (IBM)
2025-05-13 8:10 ` [PATCH v1 2/3] new: Replace "status=0; exit 0" with _exit 0 Nirjhar Roy (IBM)
@ 2025-05-13 8:10 ` Nirjhar Roy (IBM)
2025-05-14 5:16 ` Zorro Lang
2 siblings, 1 reply; 8+ messages in thread
From: Nirjhar Roy (IBM) @ 2025-05-13 8:10 UTC (permalink / raw)
To: fstests
Cc: linux-ext4, linux-xfs, ritesh.list, ojaswin, djwong, zlang, david,
nirjhar.roy.lists
Once a new test file is created, it needs to explicitly
added to the group.list file in tests/<FSTYPE> directory
in order for it to get run. Automate
that by running make by as a part of creation of the new
test file in the "new" script.
Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
---
new | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/new b/new
index e55830ce..647763c1 100755
--- a/new
+++ b/new
@@ -191,5 +191,13 @@ QA output created by $id
Silence is golden
End-of-File
+echo "Adding test $tdir/$id to the test list..."
+make >> /dev/null 2>&1 || true
+
+if ! grep -q $id $tdir/group.list; then
+ echo "$tdir/$id created but not added to the $tdir/group.list."
+ echo "Possible reason is make failure. Please ensure a clean build"
+fi
+
echo " done."
exit 0
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v1 3/3] new: Run make after adding a new test file
2025-05-13 8:10 ` [PATCH v1 3/3] new: Run make after adding a new test file Nirjhar Roy (IBM)
@ 2025-05-14 5:16 ` Zorro Lang
0 siblings, 0 replies; 8+ messages in thread
From: Zorro Lang @ 2025-05-14 5:16 UTC (permalink / raw)
To: Nirjhar Roy (IBM)
Cc: fstests, linux-ext4, linux-xfs, ritesh.list, ojaswin, djwong,
zlang, david
On Tue, May 13, 2025 at 08:10:12AM +0000, Nirjhar Roy (IBM) wrote:
> Once a new test file is created, it needs to explicitly
> added to the group.list file in tests/<FSTYPE> directory
> in order for it to get run. Automate
> that by running make by as a part of creation of the new
> test file in the "new" script.
I think it's not necessary to force to do that, the users can do "make -jN"
when they need :)
>
> Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
> ---
> new | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/new b/new
> index e55830ce..647763c1 100755
> --- a/new
> +++ b/new
> @@ -191,5 +191,13 @@ QA output created by $id
> Silence is golden
> End-of-File
>
> +echo "Adding test $tdir/$id to the test list..."
> +make >> /dev/null 2>&1 || true
> +
> +if ! grep -q $id $tdir/group.list; then
> + echo "$tdir/$id created but not added to the $tdir/group.list."
> + echo "Possible reason is make failure. Please ensure a clean build"
> +fi
> +
> echo " done."
> exit 0
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 2/3] new: Replace "status=0; exit 0" with _exit 0
2025-05-13 8:10 ` [PATCH v1 2/3] new: Replace "status=0; exit 0" with _exit 0 Nirjhar Roy (IBM)
@ 2025-05-14 5:20 ` Zorro Lang
0 siblings, 0 replies; 8+ messages in thread
From: Zorro Lang @ 2025-05-14 5:20 UTC (permalink / raw)
To: Nirjhar Roy (IBM)
Cc: fstests, linux-ext4, linux-xfs, ritesh.list, ojaswin, djwong,
zlang, david
On Tue, May 13, 2025 at 08:10:11AM +0000, Nirjhar Roy (IBM) wrote:
> We should now start using _exit 0 for every new test
> that we add.
>
> Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
> ---
> new | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/new b/new
> index 139715bf..e55830ce 100755
> --- a/new
> +++ b/new
> @@ -176,8 +176,7 @@ exit
> #echo "If failure, check \$seqres.full (this) and \$seqres.full.ok (reference)"
>
> # success, all done
> -status=0
> -exit
> +_exit 0
Hmm, this makes sense after we have:
744623644 common: Move exit related functions to a common/exit
Reviewed-by: Zorro Lang <zlang@redhat.com>
> End-of-File
>
> sleep 2 # latency to read messages to this point
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/3] new: Add a new parameter (name/emailid) in the "new" script
2025-05-13 8:10 ` [PATCH v1 1/3] new: Add a new parameter (name/emailid) in the "new" script Nirjhar Roy (IBM)
@ 2025-05-14 5:36 ` Zorro Lang
2025-05-14 6:39 ` Nirjhar Roy (IBM)
0 siblings, 1 reply; 8+ messages in thread
From: Zorro Lang @ 2025-05-14 5:36 UTC (permalink / raw)
To: Nirjhar Roy (IBM)
Cc: fstests, linux-ext4, linux-xfs, ritesh.list, ojaswin, djwong,
zlang, david
On Tue, May 13, 2025 at 08:10:10AM +0000, Nirjhar Roy (IBM) wrote:
> This patch another optional interactive prompt to enter the
> author name and email id for each new test file that is
> created using the "new" file.
>
> The sample output looks like something like the following:
>
> ./new selftest
> Next test id is 007
> Append a name to the ID? Test name will be 007-$name. y,[n]:
> Creating test file '007'
> Add to group(s) [auto] (separate by space, ? for list): selftest quick
> Enter <author_name> <email-id>: Nirjhar Roy <nirjhar.roy.lists@gmail.com>
> Creating skeletal script for you to edit ...
> done.
>
> ...
> ...
>
> Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
> ---
> new | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/new b/new
> index 6b50ffed..139715bf 100755
> --- a/new
> +++ b/new
> @@ -136,6 +136,9 @@ else
> check_groups "${new_groups[@]}" || exit 1
> fi
>
> +read -p "Enter <author_name> <email-id>: " -r
I think most of "YOUR NAME HERE" are the name of company, e.g.
"Oracle, Inc", "Red Hat, Inc". Some authors just write their names, e.g.
"Filipe Manana", "Chao Yu"...
So I think the "<email-id>" hint isn't necessary. If someone need that, he
can write it with his name together.
Thanks,
Zorro
> +author_name="${REPLY:=YOUR NAME HERE}"
> +
> echo -n "Creating skeletal script for you to edit ..."
>
> year=`date +%Y`
> @@ -143,7 +146,7 @@ year=`date +%Y`
> cat <<End-of-File >$tdir/$id
> #! /bin/bash
> # SPDX-License-Identifier: GPL-2.0
> -# Copyright (c) $year YOUR NAME HERE. All Rights Reserved.
> +# Copyright (c) $year $author_name. All Rights Reserved.
> #
> # FS QA Test $id
> #
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/3] new: Add a new parameter (name/emailid) in the "new" script
2025-05-14 5:36 ` Zorro Lang
@ 2025-05-14 6:39 ` Nirjhar Roy (IBM)
0 siblings, 0 replies; 8+ messages in thread
From: Nirjhar Roy (IBM) @ 2025-05-14 6:39 UTC (permalink / raw)
To: Zorro Lang
Cc: fstests, linux-ext4, linux-xfs, ritesh.list, ojaswin, djwong,
zlang, david
On 5/14/25 11:06, Zorro Lang wrote:
> On Tue, May 13, 2025 at 08:10:10AM +0000, Nirjhar Roy (IBM) wrote:
>> This patch another optional interactive prompt to enter the
>> author name and email id for each new test file that is
>> created using the "new" file.
>>
>> The sample output looks like something like the following:
>>
>> ./new selftest
>> Next test id is 007
>> Append a name to the ID? Test name will be 007-$name. y,[n]:
>> Creating test file '007'
>> Add to group(s) [auto] (separate by space, ? for list): selftest quick
>> Enter <author_name> <email-id>: Nirjhar Roy <nirjhar.roy.lists@gmail.com>
>> Creating skeletal script for you to edit ...
>> done.
>>
>> ...
>> ...
>>
>> Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
>> ---
>> new | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/new b/new
>> index 6b50ffed..139715bf 100755
>> --- a/new
>> +++ b/new
>> @@ -136,6 +136,9 @@ else
>> check_groups "${new_groups[@]}" || exit 1
>> fi
>>
>> +read -p "Enter <author_name> <email-id>: " -r
> I think most of "YOUR NAME HERE" are the name of company, e.g.
> "Oracle, Inc", "Red Hat, Inc". Some authors just write their names, e.g.
> "Filipe Manana", "Chao Yu"...
>
> So I think the "<email-id>" hint isn't necessary. If someone need that, he
> can write it with his name together.
Okay, I can change it to in V2:
read -p "Enter <author_name> " -r
Does this look good?
--NR
>
> Thanks,
> Zorro
>
>> +author_name="${REPLY:=YOUR NAME HERE}"
>> +
>> echo -n "Creating skeletal script for you to edit ..."
>>
>> year=`date +%Y`
>> @@ -143,7 +146,7 @@ year=`date +%Y`
>> cat <<End-of-File >$tdir/$id
>> #! /bin/bash
>> # SPDX-License-Identifier: GPL-2.0
>> -# Copyright (c) $year YOUR NAME HERE. All Rights Reserved.
>> +# Copyright (c) $year $author_name. All Rights Reserved.
>> #
>> # FS QA Test $id
>> #
>> --
>> 2.34.1
>>
>>
--
Nirjhar Roy
Linux Kernel Developer
IBM, Bangalore
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-05-14 6:39 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-13 8:10 [PATCH v1 0/3] new: Improvements to new script Nirjhar Roy (IBM)
2025-05-13 8:10 ` [PATCH v1 1/3] new: Add a new parameter (name/emailid) in the "new" script Nirjhar Roy (IBM)
2025-05-14 5:36 ` Zorro Lang
2025-05-14 6:39 ` Nirjhar Roy (IBM)
2025-05-13 8:10 ` [PATCH v1 2/3] new: Replace "status=0; exit 0" with _exit 0 Nirjhar Roy (IBM)
2025-05-14 5:20 ` Zorro Lang
2025-05-13 8:10 ` [PATCH v1 3/3] new: Run make after adding a new test file Nirjhar Roy (IBM)
2025-05-14 5:16 ` Zorro Lang
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).