netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1 V2] Selftests: net: Improve missing modules error message
@ 2024-08-23  5:48 David Hunter
  2024-08-26 15:50 ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: David Hunter @ 2024-08-23  5:48 UTC (permalink / raw)
  To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Shuah Khan
  Cc: David Hunter, netdev, linux-kselftest, linux-kernel,
	Javier Carrasco

The error message descirbing the required modules is inaccurate.
Currently, only  "SKIP: Need act_mirred module" is printed when any of
the modules are missing. As a result, users might only include that
module; however, three modules are required.

Fix the error message to show any/all modules needed for the script file
to properly execute.

Signed-off-by: David Hunter <david.hunter.linux@gmail.com>
---
V1 --> V2 
	- included subject prefixes 
	- Split the patch into two separate patches (one for each issue)
	- fixed typos in message body
	- removed second, unnecessary for loop
---
 .../selftests/net/test_ingress_egress_chaining.sh     | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/test_ingress_egress_chaining.sh b/tools/testing/selftests/net/test_ingress_egress_chaining.sh
index 08adff6bb3b6..d4b97662849b 100644
--- a/tools/testing/selftests/net/test_ingress_egress_chaining.sh
+++ b/tools/testing/selftests/net/test_ingress_egress_chaining.sh
@@ -13,10 +13,19 @@ if [ "$(id -u)" -ne 0 ];then
 fi
 
 needed_mods="act_mirred cls_flower sch_ingress"
+mods_missing=""
+numb_mods_needed=0;
+
 for mod in $needed_mods; do
-	modinfo $mod &>/dev/null || { echo "SKIP: Need act_mirred module"; exit $ksft_skip; }
+	modinfo $mod &>/dev/null ||
+	{ mods_missing="$mods_missing$mod " ; numb_mods_needed=$(expr $numb_mods_needed + 1);}
 done
 
+if [[ $numb_mods_needed>0 ]]; then
+	echo "SKIP: $numb_mods_needed modules needed: $mods_missing" ; exit $ksft_skip;
+fi
+
+
 ns="ns$((RANDOM%899+100))"
 veth1="veth1$((RANDOM%899+100))"
 veth2="veth2$((RANDOM%899+100))"
-- 
2.43.0


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

* Re: [PATCH 1/1 V2] Selftests: net: Improve missing modules error message
  2024-08-23  5:48 [PATCH 1/1 V2] Selftests: net: Improve missing modules error message David Hunter
@ 2024-08-26 15:50 ` Jakub Kicinski
  2024-08-27 20:56   ` [PATCH 1/1 V3] selftests: net: improve " David Hunter
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2024-08-26 15:50 UTC (permalink / raw)
  To: David Hunter
  Cc: David S . Miller, Eric Dumazet, Paolo Abeni, Shuah Khan, netdev,
	linux-kselftest, linux-kernel, Javier Carrasco

On Fri, 23 Aug 2024 01:48:30 -0400 David Hunter wrote:
> Subject: [PATCH 1/1 V2] Selftests: net: Improve missing modules error message

don't capitalize the prefix

> The error message descirbing the required modules is inaccurate.

spellcheck the commit message, please

> Currently, only  "SKIP: Need act_mirred module" is printed when any of
> the modules are missing. As a result, users might only include that
> module; however, three modules are required.

>  needed_mods="act_mirred cls_flower sch_ingress"
> +mods_missing=""
> +numb_mods_needed=0;

trailing semicolon

> +
>  for mod in $needed_mods; do
> -	modinfo $mod &>/dev/null || { echo "SKIP: Need act_mirred module"; exit $ksft_skip; }
> +	modinfo $mod &>/dev/null ||
> +	{ mods_missing="$mods_missing$mod " ; numb_mods_needed=$(expr $numb_mods_needed + 1);}

this is getting too long, use a "&& continue" instead of ||

>  done
>  
> +if [[ $numb_mods_needed>0 ]]; then

no need to use [[]], -gt

> +	echo "SKIP: $numb_mods_needed modules needed: $mods_missing" ; exit $ksft_skip;

why single line with semicolons, it can be two lines

> +fi
> +
> +
-- 
pw-bot: cr

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

* [PATCH 1/1 V3] selftests: net: improve missing modules error message
  2024-08-26 15:50 ` Jakub Kicinski
@ 2024-08-27 20:56   ` David Hunter
  2024-08-27 21:06     ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: David Hunter @ 2024-08-27 20:56 UTC (permalink / raw)
  To: kuba
  Cc: davem, david.hunter.linux, edumazet, javier.carrasco.cruz,
	linux-kernel, linux-kselftest, netdev, pabeni, shuah

The error message describing the required modules is inaccurate.
Currently, only  "SKIP: Need act_mirred module" is printed when any of
the modules are missing. As a result, users might only include that
module; however, three modules are required.

Fix the error message to show any/all modules needed for the script file
to properly execute.

Signed-off-by: David Hunter <david.hunter.linux@gmail.com>
---

V1 --> V2
	- included subject prefixes 
	- split the patch into two separate patches (one for each issue)
	- fixed typos in message body
	- removed second, unnecessary for loop
V2 --> V3
	- fixed subject prefix (omit capitilization)
	- fixed spelling mistake in commit message
	- fixed coding style based on recommendations
---
 .../selftests/net/test_ingress_egress_chaining.sh    | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/test_ingress_egress_chaining.sh b/tools/testing/selftests/net/test_ingress_egress_chaining.sh
index 08adff6bb3b6..007a5d04c3e1 100644
--- a/tools/testing/selftests/net/test_ingress_egress_chaining.sh
+++ b/tools/testing/selftests/net/test_ingress_egress_chaining.sh
@@ -13,10 +13,20 @@ if [ "$(id -u)" -ne 0 ];then
 fi
 
 needed_mods="act_mirred cls_flower sch_ingress"
+mods_missing=""
+numb_mods_needed=0
+
 for mod in $needed_mods; do
-	modinfo $mod &>/dev/null || { echo "SKIP: Need act_mirred module"; exit $ksft_skip; }
+	modinfo $mod &>/dev/null && continue
+	mods_missing="$mods_missing$mod "
+	numb_mods_needed=$(expr $numb_mods_needed + 1)
 done
 
+if [ $numb_mods_needed -gt 0 ]; then
+	echo "SKIP: $numb_mods_needed modules needed: $mods_missing"
+	exit $ksft_skip
+fi
+
 ns="ns$((RANDOM%899+100))"
 veth1="veth1$((RANDOM%899+100))"
 veth2="veth2$((RANDOM%899+100))"
-- 
2.43.0


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

* Re: [PATCH 1/1 V3] selftests: net: improve missing modules error message
  2024-08-27 20:56   ` [PATCH 1/1 V3] selftests: net: improve " David Hunter
@ 2024-08-27 21:06     ` Jakub Kicinski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2024-08-27 21:06 UTC (permalink / raw)
  To: David Hunter
  Cc: davem, edumazet, javier.carrasco.cruz, linux-kernel,
	linux-kselftest, netdev, pabeni, shuah

On Tue, 27 Aug 2024 16:56:29 -0400 David Hunter wrote:
> The error message describing the required modules is inaccurate.
> Currently, only  "SKIP: Need act_mirred module" is printed when any of
> the modules are missing. As a result, users might only include that
> module; however, three modules are required.
> 
> Fix the error message to show any/all modules needed for the script file
> to properly execute.
> 
> Signed-off-by: David Hunter <david.hunter.linux@gmail.com>

Please don't post patches in reply to:

Quoting documentation:

  Resending after review
  ~~~~~~~~~~~~~~~~~~~~~~
  
  Allow at least 24 hours to pass between postings. This will ensure reviewers
  from all geographical locations have a chance to chime in. Do not wait
  too long (weeks) between postings either as it will make it harder for reviewers
  to recall all the context.
  
  Make sure you address all the feedback in your new posting. Do not post a new
  version of the code if the discussion about the previous version is still
  ongoing, unless directly instructed by a reviewer.
  
  The new version of patches should be posted as a separate thread,
  not as a reply to the previous posting. Change log should include a link
  to the previous posting (see :ref:`Changes requested`).
  
See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#resending-after-review

Our patch queue is too long right now for me to handle incorrectly
posted patches, sorry, please repost tomorrow (v4 or v3 REPOST).
-- 
pw-bot: cr

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

end of thread, other threads:[~2024-08-27 21:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-23  5:48 [PATCH 1/1 V2] Selftests: net: Improve missing modules error message David Hunter
2024-08-26 15:50 ` Jakub Kicinski
2024-08-27 20:56   ` [PATCH 1/1 V3] selftests: net: improve " David Hunter
2024-08-27 21:06     ` Jakub Kicinski

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).