new: Improvements to new script
cover new: Improvements to new script
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
PATCH 1/3 new: Add a new parameter (name/emailid) in the "new" script
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 <[email protected]> Creating skeletal script for you to edit ...
done.
...
...
--- new | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
new +4 -1
@@ -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 #
Signature · 1 line
2.34.1
Re: [PATCH v1 1/3] new: Add a new parameter (name/emailid) in the "new" script
Quoted 28 lines · Nirjhar Roy (IBM)
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 <[email protected]> Creating skeletal script for you to edit ...
done....
...Signed-off-by Nirjhar Roy (IBM) <[email protected]>--- new | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)new +0
-0
new else · line 139
Quoted 4 lines
new +1
-0@@ -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
Quoted 18 lines
new +3
-1+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 #Signature · 1 line
2.34.1
Re: [PATCH v1 1/3] new: Add a new parameter (name/emailid) in the "new" script
Quoted 32 lines · Zorro Lang
Quoted 31 lines · Nirjhar Roy (IBM)
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 <[email protected]> Creating skeletal script for you to edit ...
done....
...Signed-off-by Nirjhar Roy (IBM) <[email protected]>--- new | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)new +0
-0@@ -136,6 +136,9 @@ else check_groups "${new_groups[@]}" || exit 1 fi
Quoted 7 lines
new else · line 139
Quoted 1 line
new +1
-0+read -p "Enter <author_name> <email-id>: " -rI 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
Quoted 22 lines
Thanks,
ZorroQuoted 18 lines
new +3
-1+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 #Signature · 1 line
2.34.1
Signature · 3 lines
Nirjhar Roy Linux Kernel Developer IBM, Bangalore
PATCH 2/3 new: Replace "status=0; exit 0" with _exit 0
In reply to Nirjhar Roy (IBM)We should now start using _exit 0 for every new test that we add.
--- new | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
new +1 -2
@@ -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
Signature · 1 line
2.34.1
Re: [PATCH v1 2/3] new: Replace "status=0; exit 0" with _exit 0
Quoted 13 lines · Nirjhar Roy (IBM)
We should now start using
_exit0 for every new test that we add.Signed-off-by Nirjhar Roy (IBM) <[email protected]>--- new | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)new +0
-0
new exit · line 179
Quoted 6 lines
new +1
-2@@ -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
Quoted 7 lines
new +0
-0End-of-File sleep 2 # latency to read messages to this pointSignature · 1 line
2.34.1
PATCH 3/3 new: Run make after adding a new test file
In reply to Nirjhar Roy (IBM)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.
--- new | 8 ++++++++ 1 file changed, 8 insertions(+)
new +8 -0
@@ -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
Signature · 1 line
2.34.1
Re: [PATCH v1 3/3] new: Run make after adding a new test file
Quoted 5 lines · Nirjhar Roy (IBM)
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 :)
Quoted 28 lines
Signed-off-by Nirjhar Roy (IBM) <[email protected]>--- new | 8 ++++++++ 1 file changed, 8 insertions(+)new +8
-0@@ -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 0Signature · 1 line
2.34.1